How to spawn an actor in front of the player's view?

I was wondering how I could spawn an actor using the view of the player’s camera, so in the Transform it would change the X and Y like so :
If the camera has 0° it the X would be 100% and the Y 0%, when 90° the X would be 0% and the Y 100%, at 180° X at -100% and Y at 0% so I thought I’d lerps to change the value of X and Y but I can’t figure out how to make it properly, I need to get the orientation of the camera, make it change from -100 to 100 and use this in the Alpha of the Lerp but it doesn’t seem right.
Has anyone a better idea ?
Thank you

Solution in the picture should work if im not mistaken (i’m more of a c++ programmer).

No it just spawns the actor at 20,0,0 location, I tried adding the transform of the player so it now spawns the actor at the location of the player with the 20 X added to its location but it spawns the actor depending on the direction the mesh of the character is facing so in 3rd person it doesn’t spawn where the camera is looking

I’ve tried to lerp between two X locations where the orientation of the camera goes from 0 when I look to the right to 100 when I look to the left and plugged that value into the Alpha of the Lerp (lerping between 250 et -250 for test).

But when I look at the values that come out of the lerp I think there’s something wrong because I get from 0 to 50 000, quite far from the 250 to -250.

Why do I get such values ? Here’s the blueprint :

I don’t mean to necro this thread, but I ran across it when I was tyring to place one actor in front of another. Here is the solution in Blueprint.

Basically. Multiply the Forward Vector by the distance and add that to the starting location vector. Here’s a pic.

1 Like

This should work fine. Changing multiplication value should determine how much in front does it spawns. But for some reason in my project it doesn’t. Help!