I spawn the vehicle into the level by this blueprint node where vehicle variable contains the selected vehicle from main menu.
Here is the main problem, how can I respawn the selected vehicle as I have no parameter to connect the vehicle variable.
I spawn the vehicle into the level by this blueprint node where vehicle variable contains the selected vehicle from main menu.
Here is the main problem, how can I respawn the selected vehicle as I have no parameter to connect the vehicle variable.
hi @Anqeror
dont you need to spawn a pawn for the actor to possess on respawn?
I’ve found a better solution, once I spawned the selected vehicle into the level, I will teleport it rather than destroying and respawning it.
First I’ll set Respawn location into the transform variable and set checkpoint Boolean to be true:
I’ll check if the player has cleared the checkpoint or not. If it does, I’ll teleport it to the checkpoint:
But if it doesn’t, I’ll teleport it to its initial location in the level.
this is how I will save the initial location of the player as it spawns (using gamemode blueprint):
and this is how I’ll teleport it to its initial location:
This is more effective and optimized way rather than destroying and respawning the actor. It took me a whole month find this easy respawning system. It can be done with more optimized way. I’ll hope no one will suffer this pain again in future.
Thankyou!
or you could save all that code and respawn a new vehicle and possess it?
Surely you have to reset any damage or variables attached to the actor where as a freshly spawned actor will have this already?
But if it works and you prefer it then good on you!
Yeah this works best in my case as I don’t have any damage variable for the actor. All I have is death count variable which will be incremented on overlapping the obstacle or killzone and have limited death count. After that game gets over.
Thankyou for your support, appreciate it.
Absolutely, there is not always a right and wrong!