Download

Spawn Ai Actor spawns actor in the air

So I designed a spawning blueprint for these zombies and they are suppose to be crawling out of the ground, but they spawn in from the sky and fall into the world. I’d like to eliminate that entirely if possible but I am not sure how to do it.

Here is an example of my problem: Screen capture - 013c8587a45354378f06bfc3d91fb053 - Gyazo

Here is my zombie character event graph: Screenshot - 2c3fd6c7b2093c502a57d75029cc9955 - Gyazo

Here is my spawning blueprint: Screenshot - 30d2ff100476377394b2bbacf26c89de - Gyazo

Any help appreciated!

Does it spawn at the correct location when you specify the location of Spawn AI From Class node directly instead of using the random point operation?

Could be due to the idle/walk animation? Maybe set a default idle on floor lying animation, and on change pose on bool set the correct blendspace.

It does spawn in the correct location, I have even tried bringing the Z value down to the value of the landscape at the chosen point

I think this could be the solution, I will have to try that.

It could be very tricky, if you spawn below the landscape the AI will fall. Maybe use a root motion animation/montage (if you have this animation in RM). Because even when the zombie is on the ground lying, it is visible, if not likely below the landscape and could fall. With root motion you may circumvent it. Maybe try to spawn the AI with the spawn vector added a -10Z pixel then you try to tweak it from there …

Or try to set the visibility of the AI Actor to hidden (so that you do not see the falling part), make it visible from begin Event after 1 delay maybe 2, tweak…

Or edit the animation, cut the first few frames where the AI is falling.

Maybe your spawner have higher “pivot” (or z value). You can get Random point in Bounding box (it will also random Z value), from there line trace for ground (only Z) and correct location so your character will always spawn on the ground.

Also, you can check what’s going on like this:
Disconnect all nodes in your Zombie Character BP in Begin Play event, Set Anim Class to None and Set Gravity to 0 from settings panel. Now you can spawn static/non movable character and check where it’s spawning and also check if there’s problem with animation or spawn location.
After that you can connect all nodes again, Set Gravity and animation class.

What do you mean by Root motion?
The zombie spawns at the point I want it too, the crawling out of the ground animation starts the zombie below the surface of whatever it spawns at, so there is no standing zombie in the beginning of that animation.

I did try the Actor hidden trick, but it also did not work.

I have tried that before with the same result.

I did this as well, it doesn’t seem to happen but it also just spawns a T posing zombie so its hard to tell if it happens at all.

Thanks for the suggestions. Ill write back if i have any more ideas.

Try to place skeletal mesh with only first animation or montage. Maybe unit23 is right and It’s because of root motion.