Rolling ball game checpoint and reset level

Hi there :slight_smile:

I made a simple respawn system for a Rolling Ball game.

TriggerBox is the “safety net” under the level so when the Ball hits it it is moved to a new location.
TriggerBox2 and TriggerBox3 are the checkpoints.
I hit some problems altough.

  1. The respawn position is the last position of the Ball when it hit the Triggerbox. I would like it to be the center of the Triggerbox instead. Any ideas how could I get the location of the Triggerbox (Checkpoint) at Collision?

  2. At the moment all the checkpoints need to be set up manually, which probably is not the best way to do it. Any advice on how can I make a respawn point which I can copy+paste or is more simple to set up than this?

  3. I use ExecuteConsoleCommand: RestartLevel. to reset the puzzles, but it resets the respawn position as well. Could you recommend a way so I can keep the respawn position?

Thanks in advance, any help is really appreciated :slight_smile:

Ok, starting from the easy one:

  1. You can just create a quick save and load it or store it in a variable in a game instance blueprint.

1&2) I would actually change the system if your safety net is always at the same height (let’s say at Z = 0). You can use a similar checkpoint logic that is used in the campaing missions of CoD series: it just checks if your character is safe at the moment and if so saves that moment as a checkpoint. In your case I would just check the position of the ball at every tick (or every couple of ticks) and see if its above the Z = 0 + (ball radius) level. If so, I would save the location as the checkpoint. This way you can make everything completely automatic and ditch the trigger boxes.

Hi alperenakyuz,

thanks for the quick response :slight_smile:

  1. I will definitely try to save the variable in the game instance, that should solve the issue, thanks.

1/2) I use fixed checkpoints like for example the one in Ballance, it is better to save the progress after every (couple) solved puzzle. Your idea is great it just doesn’t fit to my game. I should be more specific in the first place, sorry :slight_smile:

I figured out the solution for question 1 typical amateur hour, didn’t know how to create reference to an actor. I found the solution here:
https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/PossessPawns/Blueprints/index.html

Since I got that, it is easy to set that actors position as spawn point. Question 2 is still a problem tho :slight_smile:

Cheers. Would you mind accepting the answer, so the question would show as resolved? Thx.

Will do when I get a solution for 2 and can make 3 work :slight_smile: I don’t want to close it until I’m sure it solves the problem and all the questions are answered, so people can find the solution here if they look for it :slight_smile: