# Spawn actors below 0 z location...

I used this script

and so I can spawn some actors in my map. After some calculations spawns the actor arount the z=-1 (upwards - downwards axis). The problem comes when I try to spawn actors below 0 and -1 at e.g. a basement.
I split the vector and when the click occurs under z = 0 or under z = -1 the actors must spawn at a the basements floor (around -250 on z axis). However the actors are not spawned at the desired location but at the z=0 and when I have tried to adjust it to random locations… Any suggestions?

I can’t really tell from what you posted, but I’m going to make some guesses here… you’re running a line trace to hit some geometry and then you’re using the impact point as the spawn position which gets fed into the “Spawn Actor” node.

My wild guess is that the line trace is hitting some invisible geometry and returning the impact point on that geometry. You probably aren’t ignoring this actor, or your line trace is using the wrong collision channels.

Yeap! When click is pressed the line trace hits a mesh and the location of the “hit” is the spawning point. The colission is fine. The object is e.g. a ship. The upper floor is z>0 but the lower floor is z<0. It works on the upper floor but the lower floor spawning point is random… I guess that the multiply of -1 must be replaced with other z value. Other suggestions?

Yeah, I’m 99.99999% sure this have nothing to do with the Z value of a spawned object. You can confirm this yourself by manually setting a spawn position with a negative z value. When you do this, make sure that the object is not colliding with anything else (ie, it’s really far off the map). You’ll find that you can spawn an object just fine, so you can rule that hypothesis out. The more likely problem is that you’re trying to spawn an object and the spawning of that object at the given position would have a collision with another object and your spawn settings would probably be set to “don’t spawn” instead of “ignore collisions” or “try to adjust, but always spawn”. Regardless, you have some isolating and testing to do to narrow down the scope of your problem.