"Back on the road" system...?

Hello everyone,

I was wondering how to make a system like “if the car falls in the water, it reappears on the road closest to it”

I think it’s difficult but then I don’t know I ask anyway.

Someone have a solution please ?

is the road a single actor? How is it constructed?

The road is static mesh but i can put it in a BP Actor if it’s necessary.

You could add a spline throughout the road where you want the car to appear and use the Find Location Closest to World Location node

2 Likes

something like this ^ was going to be what I suggested. But the closest thing you find depends on how you’ve set it up so far.

Whether it’s a spline, or individual actors, or something else. But the basic idea is, get the nearest unit of road, move car back to it.

You can make some code to find the appropriate spot programmatically but I’d just do like extrone said and manually place some locators.

On the begin play of the locators you could have them report to game mode (e.g. pass a self reference to the game mode) and then game mode can put them into an array.

This way you don’t have to use “Find all actors”, you can just for each through the array to find nearest one to the players position.

1 Like

Allright. Thank you for this help
I can put a system by controller input too, Instead of the custom event “Back on Road”, i can put a key on the controller.