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

  • Try view some tutorials on YouTube, read forums, make couple singleplayer games. I see your knowledge level in development - to be honest it is poor. Raise your experience by working hard. Nobody likes dudes who just came and speak "I'm newbie guys, sorry, so tell me please why [this] is not working"