Online collisions are completely inelastic
Options
Hello, I'm making an online racing game with Photon, and the collisions are behaving completely different when online or offline.
For example if a moving vehicle collides head-on with a stationary vehicle, the first vehicle is supposed to lose speed, and the second vehicle is supposed to start moving backwards. That's what happens when offline. But online, the collision is completely inelastic. The stationary vehicle rotates for a second, but it doesn't get any speed.
I have the game configured so each player is the owner of its vehicle, so they see it move smoothly. Is that the problem? Should I change it so all cars are owned by the master? Thanks!
For example if a moving vehicle collides head-on with a stationary vehicle, the first vehicle is supposed to lose speed, and the second vehicle is supposed to start moving backwards. That's what happens when offline. But online, the collision is completely inelastic. The stationary vehicle rotates for a second, but it doesn't get any speed.
I have the game configured so each player is the owner of its vehicle, so they see it move smoothly. Is that the problem? Should I change it so all cars are owned by the master? Thanks!
0
Best Answers
-
I found the problem: I was just using PhotonTransformView, but I needed also PhotonRigidbodyView.0
-
Scratch that. Having both views causes glitching. PhotonRigidbodyView does indeed update the vehicle's position and rotation, so PhotonTransformView should be removed.0
Answers
-
I found the problem: I was just using PhotonTransformView, but I needed also PhotonRigidbodyView.0
-
Scratch that. Having both views causes glitching. PhotonRigidbodyView does indeed update the vehicle's position and rotation, so PhotonTransformView should be removed.0
-
Scratch that. Making the PhotonRigidbodyView synchronize velocities also causes glitches. I'm making my own view that updates velocities only. It's buggy for now, but when I'm done I'll publish it here.0