So, this is causing me few headaches, so I thought I’d ask on here…
I’m trying to work out how to spawn an actor at a random location within a defined ‘area’ that is based on the player location (which I can do), but that also takes into account the player rotation (which I can’t do!).
The idea being that then I could always spawn something behind, in front of or off to one side of the player.
I can do this without taking into account the player’ location - just the location, break the vector, apply some offsets and then remake the vector.
This gives this:
Hi Sachamora,
Thanks for the advice - I think that all makes sense! Don’t know why I didn’t think of doing it like that…!
I’ll give it a go and let you know how I get on…
Hey!
So, it turns out, I didn’t understand your reply as well as I thought once I tried to implement it!
If I just use the vector based on the GetForwardVector things spawn in a nice line directly behind the player and taking into account for the player rotation. If I use the GetRightVector they do the same, but obviously in a line to the left/right of the player.
However, the problem comes when I try and combine these 2 vectors… If I do vectorF + vectorR (or localX + localY in your pseudo code) then it doesn’t work - have I got something wrong?
I’m doing this in a BP - so here’s a screenshot of my setup