How can I move a physics object to its original location when a key is pressed?

I have a ball with physics that falls down when the game starts. I would like to be able to reset it to its location before it falls by hitting a key on the keyboard. I am new to Unreal Engine so I’m not sure how to do this.

Hey @MelonTheCuber! Welcome to the forums!

So on the ball actor you can use “Keyboard ___” and fill in the blank with the key you want, and use that event.

On BEgin play, you want to save the location of the ball.

When you press that button, use Set Location with Self as the input object, and use the variable you saved on begin play for your location to set to! :slight_smile:

Should be as simple as that. Let us know if you need more info!

Thanks for the help! What do you mean by self as the input? This is what i have now:

if you could send an image of what it should look like that would be helpful

Use a SetActorLocation node where that set location node is. Then use self as the target. That plain Set Location is for camera stuff.

Like so:

If keyboard events aren’t working in the actor, add the actor to the level blueprint and call the reset event from there:

Initially I had R call ResetMe in bp_balltest. but the actor wasn’t receiving input.

Thank you this worked perfectly!

1 Like

Hey,

I try to do this in my VR-Project, but am not able to implement the ResetMe-Function and the BallActor into my VRPawn. If I implement the ResetMe-Function the target is alsways the VRPawn, but I think it should be the Ball Blueprint. How can I change that and how I get the BP_Ball in it? Drag and Drop from the ContentBrowser or Outliner doesnt work…