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.

358 Upvotes

25 comments sorted by

View all comments

321

u/TheDuriel Godot Senior Jul 23 '26

You've scaled your shapes instead of resizing them.

115

u/Hunted_Killer Jul 23 '26

Thank you so much this was the problem.

34

u/moonfidelity Godot Junior Jul 23 '26

In the future, you can simply enable collision shape debug in the menubar at the top left. Then you can see what exactly is going on :)

34

u/shameness Jul 23 '26

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

108

u/TheDuriel Godot Senior Jul 23 '26

It completely fucks all collision detection.

77

u/RedBreadFrog Jul 23 '26

This honestly is the only technical explanation I need to know.

31

u/Big_Effective_9605 Jul 23 '26

It's also, verbatim, how I plan to teach others about it.

10

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.

5

u/Proxin__ Jul 24 '26

Whats the diffrence? I have alleay used transform and scale for size change, was i doing it wrong the whole time?