How to sync box trigger?
Options
Hello i wanna sync my script because it's a trigger, how can i do this?
my script:
my script:
using UnityEngine; public class coolhelicopter : MonoBehaviour { public Animator animator; void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { animator.SetTrigger("EYYY"); } } }
0
Comments
-
Hi @FedericoDeveloper,
Thank you for choosing Photon!
No need to sync the trigger.
Sync the objects and sync the animator using Photon observable components.
You could add photonView.IsMine check or player.IsLocal checks before setting animator trigger.
Also animator triggers are tricky to sync.0 -
Hi @FedericoDeveloper,
Thank you for choosing Photon!
No need to sync the trigger.
Sync the objects and sync the animator using Photon observable components.
You could add photonView.IsMine check or player.IsLocal checks before setting animator trigger.
Also animator triggers are tricky to sync.
Hello i'm using photon transform view and it seems that it's a bit delayed which causes some issues like this https://imgur.com/a/yjLUBWa
There is a trigger that puts the player prefab inside the helicopter so they don't fall.
Any solution?0 -
0
-
Hello, I tried photon transform view classic, And when player enter the trigger that keeps them on the moving platform the remote player, This is the script and heres a screenshot of the bug, Sometimes it works sometimes it doesnt, and the settings of photon animator view, photon transform view classic (PS: If a player joins, to them the platform will be reseted which means that it will not move for them unless he triggers it again and he will see players flying but in reality they are in the platform, i'm also using animator.play not the trigger)using UnityEngine; public class playerplatform : MonoBehaviour { public GameObject platform; void OnTriggerEnter(Collider other) { if (other.tag == "Player") { other.transform.parent = platform.transform; } } void OnTriggerExit(Collider other) { if (other.tag == "Player") { other.transform.parent = null; } } }
https://imgur.com/a/YVCAXpa
https://imgur.com/a/gsVtYyQ
https://imgur.com/a/TmGbLeD0 -
Any idea?0
-
Hi @FedericoDeveloper,
I'm really not an expert in this.
Maybe this is a teleport issue?
Not sure if there is an option to enable/allow teleport?
Also, Photon does not automatically sync transform parenting in hierarchy, so maybe you should do that per RPC.
Unrelated note: you should revert to using CompareTag as in the original post.0 -
-
Hello?0