Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

[ad_1]

I’m creating an FPS recreation in native multiplayer. One participant creates the hot-spot recreation, and the opposite one connects by means of WiFi community and performs the sport. And i’m doing this utilizing unity MultiLan Package deal obtainable in Unity Belongings Retailer.

when the participant connect with the Sport i play the participant animation like stroll , bounce and so on. However the issue is animation can play solely which participant who host the Sport, not play to different participant who be a part of the Sport in host community.

That’s Participant Script.

personal MNetwork networkSrc;
public Btn_Jump jumpScript;
public Btn_DPad Btn_DpadScript;

void Awake() {
    if (GetComponent<NetworkView>().isMine) { 
        trans = rework;
        contr = trans.GetComponent<CharacterController>();

        if (jumpScript == null) {
            jumpScript = GameObject.Discover ("3 Bounce").GetComponent<Btn_Jump> ();
        }
        if (Btn_DpadScript == null) {
            Btn_DpadScript = GameObject.Discover ("6 D-Pad").GetComponent<Btn_DPad> ();
        }
    }
}

void Begin() {
    if (GetComponent<NetworkView>().isMine) { 

        // If it is my participant : search the networkManager part  
        networkSrc = GameObject.Discover("MNetwork").GetComponent<MNetwork>();
        PlayerAnimatorComponent = GameObject.Discover ("Swat").GetComponent<Animator> ();

        FPS_Events.ChangeCharacterMotor(motor);
    }

}
 void Replace() {

    if (!networkSrc.isPlayerExitGame) {

            if (currentMotor == null)
                FPS_Events.ChangeCharacterMotor (motor);
            attempt {

                currentMotor.Replace ();
            } catch {
            }


            if (jumpScript.Player_jump) {

            } 
            if (Btn_DpadScript.Player_Run) {
                RunAnimation ();
            }

    }
}

void RunAnimation(){
    GetComponent<NetworkView> ().RPC ("SyncAnimation", RPCMode.All);
}

[RPC]
void SyncAnimation(){
    if (Btn_DpadScript.Player_Run) {
        PlayerAnimatorComponent.SetFloat ("Stroll",2f,0.1f,Time.deltaTime);

    }
}

On this Script there may be “Btn_DpadScript” object of Digital joystick Script identify is “Btn_DPad” for Participant Motion.

When participant transfer then “Player_Run” Boolean variable is true and play the Stroll animation of participant in SyncAnimation() methodology.

However it’s caught to play animation in all participant in similar community.

Anybody can know the right way to play animation in all community participant utilizing MultiLan Package deal then inform me. I am unable to present in Google Search about participant Animation in community utilizing MultiLan Package deal.

what ought to i do do not know anyone can suggestion then i actually respect thanks.

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *