So i’m trying to making the client able to spawn an object and replicate it to the server and vice versa.
But i’m clueless to say the least, watching the UE4 Function Replication video didn’t make me brighter on the subject, so i went and seeked your guys guidance on this probably very tough problem.
What class are those nodes in? You’ll generally want to call replicated events like that in a pawn class, since the controlling player always owns the pawn (Is the owning client). Another thing to note is that you must spawn things on the server for them to be replicated to all clients.
The nodes are on my Character Blue print, i do know that you must spawn things on the server for them to be replicated to all clients, but how would i do it vice versa and make the client spawn for example a bomb and then replicate it back to the other clients and the server.
The thing is, the spawn bomb event and explode is in the bomb blueprint, should these events be on the character itself? I’ll provide further screenshots of my events and nodes if needed.
Doesn’t the input action now call the spawn bomb on every single bomb there is on the level? As in if there are none, you won’t get any. But if there are four bombs, four additional bombs will spawn? I’d definitely handle the actual spawning of the bombs somewhere else.
What do you mean by every single bomb there is on the level? I’m completely lost on what you’re saying. And the spawning of the bombs is called on the characterbp but the spawn event is on the bomb.
Well, I actually pictured the concept as the player tossing the bomb. The bomb actor, say a grenade, is spawned in the world, does it’s own thing because it knows who it is – like bouncing around or rolling or whatever, then explodes and the actor is removed.
Only the player controller that does the input event to spawn the bomb should play the toss bomb animation but all the other players should see the tossing player animate and should see the bomb roll around and see it explode.