Trigger play

Options
hello, i want my script just to activate once and sync for everybody.
what i mean is that when a player triggers an animation (helicopter going by it self) it should be synced for other people too.
and when a player joins the animation must not restart in their vision.
heres the script:
using UnityEngine;

public class helicoptertrigger : MonoBehaviour
{
	public Animator animator;
	
	void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            animator.SetTrigger("helicopter");
        }
    }
}

Best Answer

Answers

  • Federico123
    Options
    if anybody knows can somebody tell me how to do it?
  • Federico123
    Options
    Also another question, how can i make so that when an animation is played (lets just say an airplane going back and forward by it self) just to have the exact same animation time, so like if a player is in that airplane players dont see him just flying and an airplane in front of him or backwards but i want them to see that hes in an airplane
  • Federico123
    Options
    Should i put photonview?
  • Federico123
    Options
    and yes im trying to do something like the helicopter in zombie escape from counter strike 1.6
  • Federico123
    Options
    beep boop, help?? im stuck here forever
  • Tobias
    Options
    How about you read and code-along some tutorials? And or read the docs while you patiently wait for someone to help?

  • Federico123
    Options
    Tobias wrote: »
    How about you read and code-along some tutorials? And or read the docs while you patiently wait for someone to help?

    Yes i did read but i dont understand the syncing for an animation that is not a player but is a object (yes 2 animators here, lava rising up and helicopter, lava by it self moves no triggers forgot to say that)
  • Federico123
    Options
    Tobias wrote: »
    How about you read and code-along some tutorials? And or read the docs while you patiently wait for someone to help?

    Yes i did read but i dont understand the syncing for an animation that is not a player but is a object (yes 2 animators here, lava rising up and helicopter, lava by it self moves no triggers forgot to say that)

    Cause when me and my friend play, he goes to the helicopter, in his visual the helicopter is flying and hes inside, but in my visual i see him flying and the helicopter is still down, same with lava, for him its really close to him but for me its not and its still rising up
  • Federico123
    Options
    Anyone reading this, i have made a new discussion i explain everything clearly, i also edited the code but i still have a sync problem, if a mod sees this, they can close this down, heres the new discussion: https://forum.photonengine.com/discussion/15769/sync-problem/p1?new=1