Duplicated GameObjects Disappearing

Hello everyone, this is my first time posting on the Unity forums so forgive me if I do anything stupid or wrong :stuck_out_tongue:

Anyway, I’m having a weird problem which has been frustrating me all day, I don’t know if it’s a bug or maybe I’m just missing something.

When I try duplicating an object which has an animation, the copy of the object always disappears when I run the game. This happens whether I copy the object with Ctrl+D or make a copy via a Prefab. I’ve also tried taking the animation out of the prefab, duplicating the object and then adding the animation to both object separately but still no luck.

I’ve uploaded a video to show you exactly what’s happening, sorry for the poor quality.

Thanks in advance!

Does it disappear, if you remove the animation completely?

It wont disappear if I remove the animation.

I’ve done a bit of reading I think what’s happening is that when I run the game, the animation is moving the to where the original GameObject is due to the animation being Global and not Local.

I’ve been told to make the Animated GameObjects children of Empty GameObjects which is supposed to make the Animation local to the position of the Empty GameObject, but that solution didn’t work for me. :confused:

it might not be dissapearing… is the animation moving both objects exactly on top of each other ? check the hierarchy view to see if there are 2 or not.

Yea the animation is moving them to the same position.

I don’t know how to make the Animation local to where the object is placed. I’ve been told to make the object a child of an empty gameobject but that didn’t work :confused:

Totally stumped…

when you made it a child of an empty gameobject… did you move both of those empty gameobjects to different positions in the world ? if so, then the objects shouldnt be at the same place…say you call your empty object ‘myPrefab’ then drag your animating object onto that.
Then clone it (ctrl-d) so you should not have 2 objects called myPrefab both at the same spot, and both with your animating object inside. now drag one of them to a different spot in space, and hit play… they shouldn;t be animating at the same spot anymore.

All those years later, and had same issue. No clear fix here but I figyred it out. See attached screenshot. Basicly the solution lies in the fact that you need to create a local space for everey prefab. Check out my hierarchy/setup, and make sure to null out the prefabs transforms inside the empty.