- Home /
Unity networking collisions with client authority
I'm using Unity version 5.4.1.
The problem: I detect collisions between objects on the server, using the IsServer check. But when a client has authority over an object and forces it against another object, the collision data from the oncollisionenter method has an impulse value of zero (0, 0, 0).
The question: I figure this is an issue because of the client having authority over the colliding object. However it is required that the client maintains his authority while doing the collision. Is there something I'm missing or is this not possible with UNet?
Answer by LK84 · Jan 12, 2017 at 11:57 AM
I reproduced your problem with a small test project, where bullets controlledby the local player collide with a cube in the scene (hence server owned). On the cube I have the following script:
[Server]
void OnCollisionEnter(Collision col)
{
RpcColDetection(col.impulse);
}
[ClientRpc]
void RpcColDetection(Vector3 impulse)
{
Debug.Log("Impact: " + impulse);
}
I get non zero Values for the impulse Vector(s. picture) . The Collision is synchronized too.
Your answer
Follow this Question
Related Questions
Turn based game server instances 1 Answer
Unity Editor Crash !!! 0 Answers
Multiplayer collision glitches 0 Answers
Unity Netwroking Layer Masks? 0 Answers