yeet
This commit is contained in:
@@ -22,6 +22,7 @@ public class PlayerPlatformerController : MonoBehaviour
|
||||
private InputActionAsset runtimeActions;
|
||||
private InputAction moveAction;
|
||||
private InputAction jumpAction;
|
||||
public float LastMoveX { get; private set; }
|
||||
private bool deviceFilterEnabled;
|
||||
|
||||
private void Awake()
|
||||
@@ -86,6 +87,10 @@ public class PlayerPlatformerController : MonoBehaviour
|
||||
}
|
||||
|
||||
var input = moveAction.ReadValue<Vector2>();
|
||||
if (Mathf.Abs(input.x) > 0.01f)
|
||||
{
|
||||
LastMoveX = input.x;
|
||||
}
|
||||
var velocity = body.linearVelocity;
|
||||
velocity.x = input.x * moveSpeed;
|
||||
body.linearVelocity = velocity;
|
||||
|
||||
Reference in New Issue
Block a user