Add controller support
This commit is contained in:
@@ -18,13 +18,19 @@ public partial class TestCharacter : CharacterBody3D
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
Velocity = CalculateCharacterMovement(delta);
|
||||
MoveAndSlide();
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (Input.IsActionJustPressed("exit"))
|
||||
GetTree().Quit();
|
||||
|
||||
if (Input.IsActionJustPressed("p1_fire") && CanShoot)
|
||||
Fire();
|
||||
if (Input.IsActionJustPressed("p1_altfire") && CanShoot)
|
||||
AltFire();
|
||||
|
||||
Velocity = CalculateCharacterMovement(delta);
|
||||
MoveAndSlide();
|
||||
}
|
||||
|
||||
private Vector3 CalculateCharacterMovement(double delta)
|
||||
|
||||
Reference in New Issue
Block a user