Skip to content

Commit

Permalink
Even better moving wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelJasik committed Jan 9, 2023
1 parent 223e9d8 commit 99efabc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 37 deletions.
31 changes: 1 addition & 30 deletions Assets/Animations/Wheels.controller
Original file line number Diff line number Diff line change
@@ -1,31 +1,5 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-6244841023836498960
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: WheelsIdle
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 5e0d73f89c94807c4a010686fa3dc9b5, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-608669967527178231
AnimatorState:
serializedVersion: 6
Expand Down Expand Up @@ -61,9 +35,6 @@ AnimatorStateMachine:
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: -6244841023836498960}
m_Position: {x: 230, y: 160, z: 0}
- serializedVersion: 1
m_State: {fileID: -608669967527178231}
m_Position: {x: 240, y: 70, z: 0}
Expand All @@ -76,7 +47,7 @@ AnimatorStateMachine:
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: -6244841023836498960}
m_DefaultState: {fileID: -608669967527178231}
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
Expand Down
8 changes: 1 addition & 7 deletions Assets/Scripts/Player/PlayerMovement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,7 @@ void FixedUpdate()
{
AirMovement();
}
if(rb.velocity.magnitude > 0.1f || rb.velocity.magnitude < -0.1f)
{
anim.speed = rb.velocity.magnitude / maxSpeed;
} else
{
anim.speed = 0;
}
anim.speed = rb.velocity.magnitude / maxSpeed;
if (rb.velocity.y > 5f || rb.velocity.y < -5)
{
foreach (ParticleSystem particle in movementEffect)
Expand Down

0 comments on commit 99efabc

Please sign in to comment.