Closed ScyDev closed 4 years ago
@ScyDev you have slave var slave_scale = Vector3()
(i.e. 0 scale by default).
This gets assigned to the objects scale at some point, which seems to make physics angry (causing the ERROR: move: Condition ' Math::is_nan(p_aabb.size.x) ' is true.
spam).
Change that to slave var slave_scale = Vector3(1,1,1)
(i.e. scale 1 by default) and the error goes away.
Not sure if this is an actual bug (are 0 scaled elements allowed in physics?) but in case my guess is that it's more a physics bug then a network one.
@AndreaCatania ?
There was no follow up, but yes, using a scale of 0 is definitely going to lead to issues with physics and rendering. The editor should now prevent it to some extent / raise warnings.
@Faless Thanks a lot!
Godot version: 3.0.6.stable.official.8214054
OS/device including version: Ubuntu 18.04 64bit
Issue description: If I run my game on two PCs across my WiFi, if two units cause a physics collision with each other, one of the units just disappears from both clients (I have not coded any such behavior). Most of the time, the client will become disconnected from the server soon after that.
The trigger is: setting the
scale
of a RigidBody withrset_unreliable("slave_scale", self.scale)
andself.scale = self.slave_scale
.If I run two instances of my game on the same PC and test multiplayer that way, this does NOT happen. Happens only on a real network, cable or wireless.
I am aware that Godot doesn't want RigidBodies to be scaled, or just resets the scale to (1, 1, 1). That's okay if there is a good reason for that. But it should not behave in such an erratic way, without a specific error.
Steps to reproduce:
scale
on the following lines and see that the error doesn't happen anymore: 4.1 https://gitlab.com/ScyDev/Critically-Entangled/blob/debugging/physics-collision-with-slave-scale-crashes/godot-project/Unit.gd#L57 4.2 https://gitlab.com/ScyDev/Critically-Entangled/blob/debugging/physics-collision-with-slave-scale-crashes/godot-project/Unit.gd#L102 4.3 https://gitlab.com/ScyDev/Critically-Entangled/blob/debugging/physics-collision-with-slave-scale-crashes/godot-project/Unit.gd#L106Minimal reproduction project:
Use this tag of my project: https://gitlab.com/ScyDev/Critically-Entangled/tree/debugging/physics-collision-with-slave-scale-crashes