- Home /
How can I move a non-player object from a client?
I have seen similar questions asked, but I have never seen an answer.
My player needs to approach a box and push it forward. That box's motion needs to be synchronized on every client. How do I initiate that push from a client?
Right now, I have a network transform on the box and a CmdMove() method on the player. When I want to push, I am activating CmdMove, which tells the box to move to the target location with MoveToward().
It is my understanding that this should call CmdMove on the server version of the player, which should activate the Move() function on the server version of the box, which should create movement, which should be mirrored on all clients by the NetworkTransform. However, the move only works when initiated by the server player. Clients trying to push the box do nothing.
Anyone able to shed light on what I need to do here would be greatly appreciated.
Answer by BlackHack_ · Aug 15, 2017 at 05:36 PM
You can only send commands from objects that have local player authority enabled, the host player has authority because he is also considered a server, just enable the local player authority on the network identity of the player to let him be able to send commands.