# Have object authority for all players on multiplayer server?

**URL:** <https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222>\
**Category:** Multiplayer & Networking\
**Tags:** object, authority, unreal-engine, Multiplayer, question\
**Created:** [December 14, 2016, 2:08am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222 "2016-12-14T02:08:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brylos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brylos](https://forums.unrealengine.com/u/Brylos)\
**Post date:** [December 14, 2016, 2:08am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222/1 "2016-12-14T02:08:59Z")

</div>

I’ve been using unity to develop a game, but I’ve run into an issue that is making me consider switching to unreal engine. The problem I’m having on unity is, I can’t have all players on a server send commands for a specific object without assigning and unassigning authority for it every time I want call a command. It of course is possible for me to get that to work, but I’m just wondering if I could get that functionality more easily with unreal engine. So is there a way to easily give all players authority over a non-player object? Any info regarding this is appreciated. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_beeaf1ad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_beeaf1ad](https://forums.unrealengine.com/u/anonymous_user_beeaf1ad)\
**Post date:** [December 14, 2016, 2:11am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222/2 "2016-12-14T02:11:55Z")

</div>

If I understand your question correctly, you are trying to allow Players to “own” an object so each player in the map can control that object regardless if they spawned it into the world?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_beeaf1ad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_beeaf1ad](https://forums.unrealengine.com/u/anonymous_user_beeaf1ad)\
**Post date:** [December 14, 2016, 2:12am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222/3 "2016-12-14T02:12:31Z")

</div>

What commands are you trying to send to the object in Unity? Could you provide examples, it will help build context.

---

<div class="post-metadata">

**Author:** ![Brylos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brylos](https://forums.unrealengine.com/u/Brylos)\
**Post date:** [December 14, 2016, 2:14am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222/4 "2016-12-14T02:14:21Z")

</div>

Yes. That’s exactly what I need.

---

<div class="post-metadata">

**Author:** ![Brylos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brylos](https://forums.unrealengine.com/u/Brylos)\
**Post date:** [December 14, 2016, 2:14am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222/5 "2016-12-14T02:14:50Z")

</div>

They are addforces to a rigidbody.

Here is the code for it

```
    [Command]
        void CmdShoot()
{
BallRigidBody.AddForce((PlayerBody.transform.forward) * ShotPowerCurrent, ForceMode.Impulse);
            BallRigidBody.AddForce((PlayerBody.transform.up) * ShotHeight, ForceMode.Impulse);
}
```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_beeaf1ad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_beeaf1ad](https://forums.unrealengine.com/u/anonymous_user_beeaf1ad)\
**Post date:** [December 14, 2016, 2:28am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222/6 "2016-12-14T02:28:52Z")

</div>

I think this is achievable in UE4. I’ll describe it from the perspective of Blueprints, I can’t say much about C++, but it should be virtually the same.

1. Your Actor/object should be spawned into the world by the server so it will replicate to all clients.
2. In Blueprints you would send an RPC (remote procedure call) from an Actor owned by the client (for example the PlayerController) to the same Actor, but the instance of it that’s on the server.
3. The RPC event will execute on the server’s version of the player’s Actor. It’s at this point that your player’s PlayerController can interact with the Actor. Any changes to the Actor that happens on the server will replicate to all clients.

I would highly recommend you to install UE4 and play around with the pre-built starter projects that already have assets and basic game play framework to make sure UE4 meets your design requirements.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_beeaf1ad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_beeaf1ad](https://forums.unrealengine.com/u/anonymous_user_beeaf1ad)\
**Post date:** [December 14, 2016, 2:29am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222/7 "2016-12-14T02:29:52Z")

</div>

Also, this is a great resource to read through about UE4 networking. [http://cedric.bnslv.de/Downloads/UE4\_Network\_Compendium\_by\_Cedric\_eXi\_Neukirchen.pdf](http://cedric.bnslv.de/Downloads/UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf)

---

<div class="post-metadata">

**Author:** ![Brylos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brylos](https://forums.unrealengine.com/u/Brylos)\
**Post date:** [December 14, 2016, 2:43am UTC](https://forums.unrealengine.com/t/have-object-authority-for-all-players-on-multiplayer-server/379222/8 "2016-12-14T02:43:53Z")

</div>

This has given me a lot to think about. Thanks a bunch for all the info 🙂
