Skip to main content
Bumped by Community user
added 875 characters in body
Source Link

I have a player controller attached to the Player prefab - along with the NGO components

Network Object Client Network Transform Network Animator

In the Network Manager I have the Player prefab added so that the host & clients will spawn when joining.

The issue I have is that the user input from client & host is controlling both prefabs on screen at the same time.

On the player controller script I have the line if (!IsOwner) return; at the start of the Update() before any movement is called

The Player Prefab is setup as follows:

  • Player (Has the Network Object & Client Network Transform components)Parent Obj

  • Controller (Has the PlayerController script attached to it)

  • Model (Has the Owner Network Animator component with the Animator applied)

Any help much appreciated.

PlayerController update():

void Update()
    {
        if(!IsOwner) return;
     
        if (!rigidbody || !animator) return;
 
        currentVelocity = rigidbody.velocity;
 
        GetAxisHistory();
 
        GetTargetHeading();
 
        GetLocomotionState();
 
        GetTurnSpeed();
 
        if (currentAnimationStates.HasFlag(AnimationPlayerStates.Pivoting))
        {
            SetTurnParams();
        }
        else if (TurnTriggerIsSet())
        {
            SetVelocityToCurrent();
        }
        else
        {
            TurnCheck();
 
            SetLocomotionVelocity();
        }
    }

enter image description here

enter image description here

I am using the New Input System

See the attached video for the issue

https://youtu.be/udOMW0Fbu14

I have a player controller attached to the Player prefab - along with the NGO components

Network Object Client Network Transform Network Animator

In the Network Manager I have the Player prefab added so that the host & clients will spawn when joining.

The issue I have is that the user input from client & host is controlling both prefabs on screen at the same time.

On the player controller script I have the line if (!IsOwner) return; at the start of the Update() before any movement is called

The Player Prefab is setup as follows:

  • Player (Has the Network Object & Client Network Transform components)Parent Obj

  • Controller (Has the PlayerController script attached to it)

  • Model (Has the Owner Network Animator component with the Animator applied)

Any help much appreciated.

See the attached video for the issue

https://youtu.be/udOMW0Fbu14

I have a player controller attached to the Player prefab - along with the NGO components

Network Object Client Network Transform Network Animator

In the Network Manager I have the Player prefab added so that the host & clients will spawn when joining.

The issue I have is that the user input from client & host is controlling both prefabs on screen at the same time.

On the player controller script I have the line if (!IsOwner) return; at the start of the Update() before any movement is called

The Player Prefab is setup as follows:

  • Player (Has the Network Object & Client Network Transform components)Parent Obj

  • Controller (Has the PlayerController script attached to it)

  • Model (Has the Owner Network Animator component with the Animator applied)

Any help much appreciated.

PlayerController update():

void Update()
    {
        if(!IsOwner) return;
     
        if (!rigidbody || !animator) return;
 
        currentVelocity = rigidbody.velocity;
 
        GetAxisHistory();
 
        GetTargetHeading();
 
        GetLocomotionState();
 
        GetTurnSpeed();
 
        if (currentAnimationStates.HasFlag(AnimationPlayerStates.Pivoting))
        {
            SetTurnParams();
        }
        else if (TurnTriggerIsSet())
        {
            SetVelocityToCurrent();
        }
        else
        {
            TurnCheck();
 
            SetLocomotionVelocity();
        }
    }

enter image description here

enter image description here

I am using the New Input System

See the attached video for the issue

https://youtu.be/udOMW0Fbu14

Source Link

Host & Client user input moving both Player prefabs at the same time

I have a player controller attached to the Player prefab - along with the NGO components

Network Object Client Network Transform Network Animator

In the Network Manager I have the Player prefab added so that the host & clients will spawn when joining.

The issue I have is that the user input from client & host is controlling both prefabs on screen at the same time.

On the player controller script I have the line if (!IsOwner) return; at the start of the Update() before any movement is called

The Player Prefab is setup as follows:

  • Player (Has the Network Object & Client Network Transform components)Parent Obj

  • Controller (Has the PlayerController script attached to it)

  • Model (Has the Owner Network Animator component with the Animator applied)

Any help much appreciated.

See the attached video for the issue

https://youtu.be/udOMW0Fbu14