Clients can't request to delete actor?
So I am trying to have an actor destroy when someone presses the interact key.
So on pressing interact, a trace for objects will be called. If the object can be destroyed, then it will call "DestroyHitActor".
This should destroy the actor hit by the trace... (Note that Actor to Destroy should be conneted to the destroy actor function.)
Problem is that the server will not allow the client to "Call DestroyHitActor".
Sorry if this is a dumb question, I'm pretty new at this.
Also, is it normal that when I have two players in a game, one is acting as a server? How can I make them both act as a client?
asked Sep 06 '15 at 05:56 PM in Blueprint Scripting
What you're running into here is a client/server replication issue - you'll need to tell the server to delete the actor for you in a multiplayer game. I'd suggest reading these to get your feet wet: https://www.unrealengine.com/blog/crash-course-in-blueprints-replication https://docs.unrealengine.com/latest/INT/Gameplay/index.html (Scroll down to the sections on replication near the bottom)
As for the second part of your question, the default behavior for UE4 is to have one instance as a listen server and the rest as connected clients.You can override this by expanding the advanced play options (the small triangle near the play button) and ticking "Dedicated Server".
answered Sep 06 '15 at 06:08 PM
I wonder if this might be a problem with the event delegate. I haven't completely grasped how replication works yet, but I know that the delegate will only fire on actors to which it is registered. You could add a Print node between the Event and the actual Destroy Actor call to see whether the event even reaches the client.
Add two more Print nodes after your cast (success/failed) to verify that the following two assumptions are actually correct:
answered Sep 06 '15 at 09:16 PM
I am having a similar issue with a door I have created. I have it so that the door can be opened and closed by the server, visually showing the door open and close to all clients connected, and the clients connected can walk through it, etc. But the server has to do all of the interaction. I can't seem to make it so that clients can trigger the door, send that information to the server and have the server replicate the data to all clients.
Where I am having a hard time is having my collision box read when the client is hitting the F key... It knows when the server does...
answered Jan 27 '16 at 11:57 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here