i have a question about enemy ai spawning, basically what im trying to achieve is when a player reaches a certain point enemy’s will come out of the ground. ive thought long and hard about this, but i cant get my head around it. i was thinking a box collider and it triggers when the player gets close, but how can i make that enemy come out f the ground :S
Yes, a trigger would be appropriate for the proximity center. As for getting the enemy to rise up out of the ground, just set its position below ground level then raise it up over the course of a few frames, just as you would manage any other type of game object motion.
thanks, so put the spawn point under ground aswell?
you can make it in two steps.
first fake enemy without collision just raises up from the ground
second, when first is done you replace the fake enemy with a real one (with collider and such)
thanks
are they already there or will you place them “on the fly?”
if already there, why not just have a “hold underground” and “climb up” animation. if the “hold underground” animation is static (a couple frames) and beneath the 0 point on the Z axis… i’m not sure how unity would handle this but that’s what i’d do an animation.
there’s little point having an active idle animation on a character that’s out of sight… yes, the spawn point (the point at which you instantiate the enemy character model) would be under ground.
To save on CPU power you could do two collider triggers one a little larger to call or spawn the creature underground and the second to begine the animation. That is how left for dead does it.
aaah, thank you for the tips! (i’m new to using Unity… can you tell? :P)
going to see about trying something like that myself. i’m sure i could make use of those techniques in the game i’m working on.