How to move object front on another

Hello,

The code I made do its job but remain a little bug, the object spawn on the correct location if I don’t move the camera, but when I rotate on the pitch axis, the object spawn a little too high or too low.

i dont know how the get vector from pitch node works.

Instead try getforwardvector from the control rotation, and multiply that by the distance you want the mesh to appear in front of the camera and add it to the camera location. I think that will work and give you a consistent distance.

I have the same problem if I use this method.

Try to do it by just multiplying the forward vector by a float, not another vector, and try it without adding Z 70.
Also I don’t think you need to do a Make Transform.

Same problem.

Hm that is strange. Maybe it will work better to get WorldRotation of the camera instead of Control Rotation. And don’t add anything to the forward vector. Just get the forward vector, multiply the whole vector by one float 70, and add to camera’s world Location.

Hey I just thought of something. Maybe the object is colliding with the player and getting pushed away so it’s not inside the player’s collision capsule. Maybe your math has been good all along but the depenetration of overlapping objects was forcing the spawned object to move before the next Tick when we see it appear.

Not worked and there is no collision issue because the object is spawn far away from the character.

I think I know what happen, it’s about the rotation center that is not set at the camera but somewhere in the camera mesh along the X axis.

I need to calibrate it.

Yes it was that, my bad, I forgot that I moved the camera at 15X and 70Z from the character, so I need to add 15X to the vector.

And it’s worked.