![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | nwgdusr999 |
Just wasted hours debugging… It seems that modifying a value of a collider modifies the colliders of all other objects of the current Scene?! This seems like a bug… Code example:
func addTileBlob(var color, i, j, scaleFactor, var targetTilesDict):
return preload("res://Orb.tscn").instance() ;
func addTileBlobDebug(var color, i, j, scaleFactor, var targetTilesDict):
var orb = preload("res://Orb.tscn").instance() ;
orb.get_node("CollisionShape2D").disabled = true;
orb.get_node("CollisionShape2D").shape.radius = .1;
The last line that modifies the radius seems to cause an issue where ALL of the orbs of the current scene (even those who are not created in this method) at one point have their radius values replaced with .1…!
I guess I have more reading about instancing… Seems quite strange that modifying an instance would modify ALL the other instances eventually without any reason that I can find… Or is this specific to the collider? It doesn’t happen right away, works for a while, then after a few collisions, boom, the radius every orb instance become .1 for no apparent reason… The disabled doesn’t seem to ‘spread’ though… (or something else is wrong I’m my code that I’m totally missing…)