Home Game Development unity – Host & Client consumer enter shifting each Player prefabs on the similar time

unity – Host & Client consumer enter shifting each Player prefabs on the similar time

0
unity – Host & Client consumer enter shifting each Player prefabs on the similar time

[ad_1]

I’ve a participant controller connected to the Player prefab – together with the NGO parts

Network Object Client Network Transform Network Animator

In the Network Manager I’ve the Player prefab added in order that the host & purchasers will spawn when becoming a member of.

The subject I’ve is that the consumer enter from consumer & host is controlling each prefabs on display on the similar time.

On the participant controller script I’ve the road if (!IsOwner) return; at first of the Update() earlier than any motion is known as

The Player Prefab is setup as follows:

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

  • Controller (Has the PlayerController script connected to it)

  • Model (Has the Owner Network Animator element with the Animator utilized)

Any assist a lot appreciated.

PlayerController replace():

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’m utilizing the New Input System

See the connected video for the problem

https://youtu.be/udOMW0Fbu14

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here