Hello!
I have a question about my NavMeshAgent and my WaveSpawnerScript.
My NavMeshAgent has an empty GameObject named ''target'' as destination. This target is linked to my character.
This all works fine!
I also have a WaveSpawnerScript.
For this I have set Enemy1 as the SpawningObject. Enemy1 is in my world as a normal object. It is also the NavMeshAgent. My WaveSpawner detects if the object Enemy is missing. Then it waits a short time and spawns new ones. But if I delete/destroy Enemy 1 (shoot at him), it doesn't know what to spawn, because Enemy 1 doesn't exist anymore.
Normally I would have solved this by making Enemy1 as prefab. But the prefab: Enemy1 also needs an Prefab as a target. But if I make the target a prefab and then make it Enemy1s destination, the agent only runs to the point 0/0/0 because the prefab target is normally stored there. Even when i put the target-prefab as a child of my character the Spawning Enemy1 isnt going to go to me. How do I do that now?
↧