Hello everyone!
My game has physics cubes which can be pushed/pulled around. By walking up to one, the character can push it around. If the player holds shift, the cube can be pulled.
My current setup assumes the player will be moving away from the cube when pulling. However, during playtesting, some players will continue to hold shift when switching from pulling to pushing. This causes the character to rotate unexpectedly.
I know what I need to do, but I'm not sure how to do it! When pulling, I need to check for the direction (raycast maybe?) between the character and the cube. If the character then moves in that direction (based on movement input relative to camera), the FSM would force the character to switch to pushing again.
In short, is there an action, or series of actions, to check if a character is moving towards an object?