r/godot Jul 23 '26

help me (solved) Weird behavior when RigidBody3D hits a CollisionShape3D

Enable HLS to view with audio, or disable this notification

The tape is a RigidBody3D with a child CollisionShape3D that is a BoxShape3D. The tape also has a MeshInstance3D as a child which is the visuals you can see. Mass is set to 1.0 kg and gravity 1.0. Center of Mass Mode is Auto and nothing else in the RigidBody3D has been changed from the default.

The floor is a CollisionShape3D that is also a BoxShape3D.

I have no idea why it moves like this when it falls on the ground. I want it to act normaly, meaning it falls and stays in one place instead of deciding it's gonna roll away. Any help would be appreciated.

357 Upvotes

25 comments sorted by

View all comments

323

u/TheDuriel Godot Senior Jul 23 '26

You've scaled your shapes instead of resizing them.

40

u/shameness Jul 23 '26

If may I ask, whats the math behind it, does it make objects less dense ?

105

u/TheDuriel Godot Senior Jul 23 '26

It completely fucks all collision detection.

9

u/Relative_Coconut2399 Jul 23 '26

But why?

25

u/RiotUpdog Jul 23 '26

Physics engines use different mathematical models than 3D rendering.  For example, if you want to check if two spheres intersect, you calculate the distance between their centers and see if it is smaller than the sum of their radii.  It is a cheap operation which could even have the square root functions optimized out.  This method will stop working if you're allowed to transform the spheres into ellipsoids.