- Home /
The problem is that when I copy an enemy mob, I lose the sounds of this enemy
I guess that the problem is that a script is attached to the mob itself, in which the animator of the mob is connected. how can this be fixed?
How do you expect people to answer your questions with so few informations?
a script is attached to the mob
What script?
the animator of the mob is connected
What animator?
Seriously, we don't know what you have in your project, you have to give us information. Help us help yourself
Answer by Marioooo · Nov 26, 2019 at 08:10 PM
are you creating an instance from a prefab right? how are you "copying" the gameobject?
If that's not the case, then create a enemy the way it should be... then create a Prefab and use:
Instantiate(enemyPrefab, location, Quaternion.Identity);
where prefab is a GameObject. You can Define it like this:
[Serializable] private GameObject enemyPrefab;
and location is a Vector3 for the position of the new instance.
for reference go to:
https://docs.unity3d.com/ScriptReference/Object.Instantiate.html