# When i played Netmode as Client, and Number of Players = 1, everything gets weird.

**URL:** <https://forums.unrealengine.com/t/when-i-played-netmode-as-client-and-number-of-players-1-everything-gets-weird/2011821>\
**Category:** Programming & Scripting\
**Tags:** client, Server, client-server, unreal-engine, question\
**Created:** [September 8, 2024, 2:47pm UTC](https://forums.unrealengine.com/t/when-i-played-netmode-as-client-and-number-of-players-1-everything-gets-weird/2011821 "2024-09-08T14:47:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trixylunamoon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@trixylunamoon](https://forums.unrealengine.com/u/trixylunamoon)\
**Post date:** [September 8, 2024, 2:47pm UTC](https://forums.unrealengine.com/t/when-i-played-netmode-as-client-and-number-of-players-1-everything-gets-weird/2011821/1 "2024-09-08T14:47:56Z")

</div>

Just hard to understand Server-Client things in Unreal Engine,

![1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/6/de621495d2efe14110c8027af0fcc83fb310cdce.png)

When i set up the editor like this, “Play As Client and Number of Players = 1”

**‘HasAuthority’ functions work well in Blueprint.**

![2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/4/df4775c1e2f3635c941b6d174a3cca868e4cbead.png)

![3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/0/6e0f7c183cdcfd0302d6a522337415f5ed68c7c8.png)

As you see.

**But in the CPP, ‘HasAuthority’ always returns false.**

```auto
void AMyCharacter::ServerDestroyThisCharacter_Implementation()
{
    if (HasAuthority())
    {
        if (IsValid(this))
        {
            Destroy();
        }
    }
}

```

If there’s a code like this, **HasAuthority phrase never passed.**

Actually, Destroy function checks the Authority Role and replicated internally,  
so the **Destroy function never completed** either.  
  
  
Is this normal ?

If so, we don’t need to test in the editor as client mode if we are making multiplayer games, do we?  
  
  
Sombody help me to understand these thing fully T^T

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [September 8, 2024, 4:20pm UTC](https://forums.unrealengine.com/t/when-i-played-netmode-as-client-and-number-of-players-1-everything-gets-weird/2011821/2 "2024-09-08T16:20:58Z")

</div>

I encountered some oddities when testing multiplayer in PIE. In 90% it works fine, but sometimes RPCs did not work correctly. When running Standalone Game - everything worked as intended, but it took much longer to load. So you should check it out.

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/1/7814845421f931446e66f20f79aff7bb054426b7.png)

Also, in most cases it is better to use the IsServer check instead of HasAutority, since the latter is not always obvious, and it is easier to make a mistake with it.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [October 10, 2024, 1:07am UTC](https://forums.unrealengine.com/t/when-i-played-netmode-as-client-and-number-of-players-1-everything-gets-weird/2011821/3 "2024-10-10T01:07:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
