This commit is contained in:
hz
2026-01-31 22:27:43 -06:00
parent e6593192a7
commit c47bd0fe27
4 changed files with 107 additions and 6 deletions
@@ -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;