OnTriggerEnter worked only on master client

Hi there
I'm newbee and I need help.

I create mechanic where if you go into collider, his changed you gravity & transform direction. It's works in singleplayer, but if I want activate this mechanic on connected client, OnTriggerEnter worked only on master client. Also i don't understand, how pun rpc worked

My code:
private void OnTriggerEnter(Collider coll)
{
if (coll.gameObject.layer == 31 && charLoco != null)
{
photonView.RPC("ChangeGravity", RpcTarget.All);
}
}

[PunRPC]
void ChangeGravity()
{
m_CharacterLocomotion.GravityDirection = grav;
}

Pls help me!

Answers

Sign In or Register to comment.