mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 03:45:55 +00:00
Basic Movement fixes
This commit is contained in:
parent
3e2b6c2c9c
commit
c9b3164362
5 changed files with 66 additions and 11 deletions
|
|
@ -25,16 +25,16 @@ public partial class PlayerMovement : CharacterBody2D
|
|||
}
|
||||
}*/
|
||||
|
||||
public void GetInput()
|
||||
public Vector2 GetInput()
|
||||
{
|
||||
|
||||
Vector2 inputDirection = Input.GetVector("left", "right", "up", "down");
|
||||
Velocity = inputDirection * Speed;
|
||||
return Input.GetVector("left", "right", "up", "down");
|
||||
}
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
GetInput();
|
||||
var inputDirection = GetInput();
|
||||
Velocity = inputDirection * (float)(Speed * delta);
|
||||
|
||||
MoveAndSlide();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue