• News

• Industries

• Learning & Support

• Community

• Marketplace

# Spawn to actor Location

Hi all…
I spawn an actor to my current actor location. All works apart if i spawn watching to my left, the actor spawn far. If i watch to the rght, the actor spawn correctly, if i watch at my left the actor spawn far… why?
https://s17.postimg.org/t7aqlbk7f/gpng.png

I assume you want to spawn something ahead of the actor?

You do this by using GetActorLocation + ( GetForwardVector x float Offset ). The Offset is the distance in centimeters ahead.

No need to break the vector return value from either GetActorLocation or GetForwardVector since you will need all 3 axes.

GetForwardVector is a 3d direction Vector and since you only use the X axis you get a 1d direction magnitude along only the x axis.

Excuse me, but i m using x, y and z, so it’s like i m using a vector. Can you show me a BP please?

I still can’t spawn it corretly… how i m suppose to do?

This should do the trick.

Offset is the distance in cm of what?

Yes how far ahead in cm. of the actor you want the location to be.

i want that the actor spawn in the same place of my previous actor… With this method, with no moltiplication, my actor still spawn every time in the same direction, no matter if i m watching at right or left

Then just use GetActorLocation

Same problem. He will spawn every time in the right direction even if i m watching at my left

As I can see in Siengried](User Profile - Unreal Engine Forums)blueprint he did not use get actor transform and the spawn actor orientation is set to 0,0,0 (default value) so it will always face at 0,0,0 orientation you need to use get actor transform and split struct pin to get the actor orientation so if you look at a direction X you are supposed to spawn the actor at the last known orientation. I don’t know if I understand correctly your issue. It might be an issue with you get forward vector returning you the wrong value check if the actor spawn always like 90 degree of where you looking at if so try (rotate vector around axis) and connect the in vector to your (get forward vector) angle degree at 90 and axis to a (get up vector)…

You right, thanks. I solved