Topic was automatically imported from the old Question2Answer platform.
Asked By
Slimeydragon
I want to use animation player to change the shape of the characters hitbox based on the attack used, but when resizing the shape of their hitbox through animation player, every other instance of that character scene has their collision shape re-sized as well, not just the one that went through the animation.
Everything else like the transform of CollisionShape2D doesn’t affect the other instances of that character, so why is shape different?
This is by design. The shape property of a CollisionShape2D is a Shape2D resource. Resource objects are passed by reference, so both instances are sharing the same shape resource.
If you want them to be unique you can choose “Make unique” on the resource in the Inspector, or you can duplicate() it in code.
I’ve chosen “Make Unique”, which didn’t work for some reason but I found that under “edit” I can tick “Local to scene” which worked, thanks!