Hi
I was wondering if anyone could help me please. I am working on my first networked game. I have an object that with the OnTriggerEnter void on it. When I enter the trigger radius - the debug.log message is not appearing on the console, clearly suggesting I am missing something.
If anyone can help it is greatly appreciated. Here is my code. The object in question has a rigidbody and is Kinematic. The IsTrigger box is ticked and it also has a Network View component attached to it.
The RPC stuff that uses the spacebar works fine. I’m just not sure how to use OnTriggerEnter when using a network.
void Update () {
if(!networkView.isMine){
return;
}
if(Input.GetKeyDown(KeyCode.Space)){
networkView.RPC("test", RPCMode.All);
}
}
void OnTrigggerEnter(Collider other) {
networkView.RPC("test", RPCMode.AllBuffered);
print("hello");
}
[RPC]
void test (NetworkMessageInfo info){
Debug.Log("Test " + info.sender.ipAddress);
}