I’m trying to make the player unable to input anything so that I can do stuff to the model. How does one do that?
Here’s my example:
bool canMove;
void Start(){
canMove = true;
controls.Player.HorizontalMovement.performed += context => _move.x = context.ReadValue<float>();
controls.Player.VerticalMovement.performed += context => _move.y = context.ReadValue<float>();
}
...
void Update(){
if(canMove){
// Movement here with Vector2 move obtained from the controls
}
}
...
void StopMovementToPlayAnimationOrDoOtherStuff(){
canMove = false;
// Do stuff here, add a timer for when canMove equals true again and can move the player
}