How to Move my Pawn up on z axis on key press and return to its previous location on release

Components
0

Variables
1

(Optional) - Construction Graph
2

Event Graph - Begin Play - Gotta make sure that if this isn’t a player character, that you enable input for the player’s controller within the platform’s event graph.

Event Graph - On designated button’s press, check if the bool is true. If it is, set the two variables as shown.
4

After setting the variables, enact whatever method you use to move the platform in whatever direction. I prefer a timeline that has it’s loop turned on.

Event Graph - On designated button’s release, put down a sequence node and set the first output to stop whatever timeline or method you used to move the platform. On the second output, check if the bool is false. If it is, I use a looping timeline to check if the platform’s location is nearly equal to the vector variable (it’s original position). If it is, set the bool to true. If it isn’t, enact whatever movement method you’ve chosen until it is.

1 Like

Tq :smiling_face_with_three_hearts::smiling_face_with_three_hearts::smiling_face_with_three_hearts: