Need help spawning enemies.

Hi, I’m trying to make a tower defence game. I already have the enemies spawning and walking to preset waypoints. The problem is with the mesh. I don’t know how to spawn them via script with a mesh I made in 3Ds Max. Currently I can only spawn preset objects, like cubes and spheres. Can anyone help me please?

It sounds like you may just need to make your mesh a prefab? Right click in the project view, click prefab, rename it to your models name then drag and drop your model from the project view to the scene view, now drag and drop your model from either the hierarchy or the scene view into the prefab you created. Now you should be able to Spawn the new prefab (your model clone). You can also delete your model from the hierarchy or scene view before spawning it :slight_smile:

hope that’s what you were looking for?

it may help to post a script? if u declaires ur var as a Transform you should be able to use the model right from the imported maxfile, do u have it declaired as a gameobject instead?

for example

var enemy1 : gameObject ;

or

var enemy1 : Transform;

yeah! that’s exactly what I needed! thank you so much, took me a while to figure out how to spawn the prefab, but I finally made it and it works perfectly now.
Thank you so much! :smile: