Godot Version
v4.3.stable.official [77dcf97d8]
Question
I have breakable objects in my 2D game which change sprites when they are hit. To make sure every breakable on the map does not change when they are hit, I check the RID so only matches change.
This is how the breakable is set up:
The highlighted StaticBodyCollider is what the player connects to.
Working with just one breakable was fine, but since duplicating them, the duplicates hold the same RID as the first breakable object. The interesting part is that the duplicates have the same RID when using get_rid().
The “this object rid” part is by using get_rid() in the breakable script and the “checking rid” part is what is returned after using get_collider_rid() from a ray in the player.
Why is the RID the same on these objects? And is it possible to access this unique ID from the editor? (I know these IDs aren’t exactly permanent, as the docs say)