The shape of Collisionis shared between seperate instances on the same scene

Godot Version

4.5.1 stable (running on linux)

Question

Hi all!, I have a question I already found here, but in my case the behavior is a little different.

I want to use animation player to change the shape of the characters collision based on the attack or other animations used, but when resizing the shape of their collision shape 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.

I tried enter to my scene, and select “local to scene” but that doesnt work. Also, I tried make the shape unique, but the same problem still happen. I tried duplicate the shape by code, and the result its always the same when I have more than one enemy instantiated:

One instance:

two or more:

Thanks in advance.

"local to scene” should work if you’re using PackedScene.instantiate(). How are you creating enemies?

1 Like

when creating the enemies, i just duplicate them in the editor(at least in this case, I dont need to do it in runtime).

Local to scene will not work if you are duplicating in the editor. You need to right click on each collision shape’s shape property and click “make unique” instead.

1 Like

yes, but that doesnt work either. Also, when you refer to the collision shape, you mean inside of the scene? because when I put my enemy on this scene, it is a scene, so its encapsulated(i know I can make it editable children or “make local”, but I think it’s not the right way to do it). I noticed when I make the resource local to scene, also fails:

It behaves like in the video n2, even when just one instance is in my level

local_to_scene should also work if you instantiate in the editor (by dragging each scene the from the file system), but not when you duplicate.

If you want to duplicate in the editor best to duplicate the resource in scene’s _ready()

“editable children” will work as well but you need to keep each scene editable which could be tedious.