Skip to content

Commit

Permalink
🥶 #3 character (gravity/rigidbody) rigging
Browse files Browse the repository at this point in the history
  • Loading branch information
Gizmotronn committed Nov 12, 2021
1 parent 04364f8 commit b90f148
Show file tree
Hide file tree
Showing 16 changed files with 606 additions and 294 deletions.
250 changes: 249 additions & 1 deletion Alien World/Assets/Character Rigging/3D Character.unity
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_IndirectSpecularColor: {r: 0.44657838, g: 0.49641234, b: 0.57481676, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
Expand Down Expand Up @@ -123,6 +123,95 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &245415491
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 245415495}
- component: {fileID: 245415494}
- component: {fileID: 245415493}
- component: {fileID: 245415492}
m_Layer: 0
m_Name: Player
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &245415492
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 245415491}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f0974bbcf867b45e6908d852d37f8c1c, type: 3}
m_Name:
m_EditorClassIdentifier:
moveSpeed: 0
walkSpeed: 5
runSpeed: 7
isGrounded: 0
groundCheckDistance: 0
groundMask:
serializedVersion: 2
m_Bits: 0
gravity: 0
--- !u!143 &245415493
CharacterController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 245415491}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Height: 1.5
m_Radius: 0.5
m_SlopeLimit: 45
m_StepOffset: 0.3
m_SkinWidth: 0.0001
m_MinMoveDistance: 0.001
m_Center: {x: 0, y: 0.75, z: 0}
--- !u!54 &245415494
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 245415491}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!4 &245415495
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 245415491}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1575602235}
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &394906126
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -206,6 +295,68 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &709935460
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 245415495}
m_Modifications:
- target: {fileID: 100050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_Name
value: ToonRTS_demo_Knight
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
--- !u!4 &1575602235 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 400050, guid: ba24e610e0a338545b447ff44a3cf1cc, type: 3}
m_PrefabInstance: {fileID: 709935460}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1674968924
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -299,3 +450,100 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &1806677012
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1806677016}
- component: {fileID: 1806677015}
- component: {fileID: 1806677014}
- component: {fileID: 1806677013}
m_Layer: 0
m_Name: Ground
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &1806677013
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1806677012}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1806677014
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1806677012}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1806677015
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1806677012}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1806677016
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1806677012}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.5, y: 1, z: 1.5}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ private void Update() {
}

private void Move() {
isGrounded = Physics.CheckSphere(transform.position, groundCheckDistance, groundMask);
isGrounded = Physics.CheckSphere(transform.position, groundCheckDistance, groundMask); // Return true whenever we're standing on the ground

if(isGrounded && velocity.y < 0) {
velocity.y = -2f;
}

float moveZ = Input.GetAxis("Vertical"); // z = forward and backwards input axes

Expand All @@ -53,6 +57,9 @@ private void Move() {
moveDirection *= moveSpeed;

controller.Move(moveDirection * Time.deltaTime);

velocity.y += gravity * Time.deltaTime; // calculate gravity
controller.Move(velocity * Time.deltaTime); // apply gravity to the character
}

private void Idle() {
Expand Down
Binary file modified Alien World/Library/ArtifactDB
Binary file not shown.
Binary file not shown.
Binary file modified Alien World/Library/Bee/200b0aE.dag_fsmtime
Binary file not shown.
Binary file modified Alien World/Library/Bee/TundraBuildState.state
Binary file not shown.
Binary file modified Alien World/Library/Bee/TundraBuildState.state.map
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit b90f148

Please sign in to comment.