Networked Teleport Respawn

I’ve searched up as many tutorials I could find but none of them suit my needs. What I’m trying to do is just have the player’s character teleport to a location rather than destroying the actor for respawning.
So far everything works fine for the server but clients do not get teleported. There’s a split second where the screen jerks in the direction of the teleport location but it goes back to the initial location of death immediately.

Here is my current setup(big image):

the widget nodes are coming from this deathscreen widget created on event play and only used for the death sequence.

Ingame if anybody dies they are supposed to be teleported to the single flagged spawn location on the map (this part works perfectly fine on the server, only clients dont get teleported)

This is all in the playercharacter blueprint. I don’t have anything else relating to death in the player controller or gamemode.

Trying to switch on replication for any event just breaks everything in-game resulting in the clients never having the deathscreen widget removed. Even more Odd is the switch movement mode event in the last comment box gets fired and nothing else. I dont have a reasonable explanation for why this might be happening.

I tried learning more about networking in blueprints but for some reason everybody else’s setup seems to work the moment they replicate and use reliable for any event. I’m at a loss for any further troubleshooting.

This is building upon the advanced locomotion marketplace character if that is relevant. I do not know all the inner workings of it yet.

Hey!

This setup seems good, except one thing.
After you fire NetworkedTeleportRespawn and do your logic you fire another event “RespawnComplete”.

In theory networked teleport respawn is a server rpc/event which means that code will run om server, but server never ever will have UMG/UI data :slight_smile: (except listen server aka first player because hes client will be a server)

So try to modify RespawnComplete and mark as Client RPC/Event :slight_smile:

Hey there.

That makes sense. I tried changing the RespawnComplete event to client replicated and the clients now teleport and remove the deathscreen widget correctly.
I’m not sure how that was affecting the teleport action though, isn’t that being fired before the RespawnComplete event? Or is it because the action carries on over into the rest of the execution chain?

Unfortunately now I am faced with a new problem where the respawn point is only looking at the server. All the clients are being teleported to the point that is activated on the server instead of individually.

In this scenario, for simplicity, I have 3 different spawns. Each client can choose one of the points to spawn from. Choosing an inactive spawn to make active will give that spawn an (active) tag while all others are replaced with an (inactive) tag. This is how I’m using the BP to look up the correct spawnpoint, which you can probably already tell.

How can I tell the server to prioritize / properly lookup the clients tagged actors over the server?

Hmm, I originally didn’t want the player to be able to choose spawnpoints on death, rather needing to choose while they were still alive but thinking about it more it does seem more ergonomic to just allow the player to choose from any of their activated spawnpoints rather than just the last one. It will take a while to properly implement this how I want so I’m gonna go ahead and mark this as answered.

Ahh then i missunderstod.
Then your set tag / search tag also can be good, just never forgeg: when you set active / inactive tag you need server authorative rights :wink:

But i recommend to create a new playerstart bp class from default playerstartclass and create there a bIsActive bool variable :slight_smile:
You can use GetAllActorOfClass to find spawn points and you can foreach loop through and find which is activated :wink:

Hey!

So your code as i see doing respawn automatically.
That means when character dies execution will run. Teleport then respawn player.

If you want include spawn selection possibility and make that available to players, you need handle this in other way :slight_smile:

Forgot tag and auto spawn, here is a much cleaner concept:

Player dies, call client function to send death widget, i assume on your widget you have some button or something so player can choose point.
Lets say if player clicked on button one, you send a Server RPC with input variable like integer and set this to one…

Now you know player selected first spawn point, you are on server because of server rpc and you have authority rights for spawn…

All data you have so you can teleport player to spawn one’s location and complete spawn with client function again (remove death widget)