Announcement
Collapse
No announcement yet.
Spawning actor on mouse position
Collapse
X
-
Youre doing your spawning using world position not relative position. You have to convert that using either getForwardVector and/or getLookRotation and adjust the spawn point accordingly.
Also, amy reason why you arent using "convert mouse position to world location"?Need another dev on your UE4 project? Send me a shoutout and I'll lend a hand
-
Originally posted by 6ixpool View PostYoure doing your spawning using world position not relative position. You have to convert that using either getForwardVector and/or getLookRotation and adjust the spawn point accordingly.
Also, amy reason why you arent using "convert mouse position to world location"?
Comment
-
I got it! Here is the blueprint:
I converted the mouse location to world space, divided the "Arm Length" of my "Spring Arm" component by the 'X' axis of the world direction and multiplied by the world direction. After that, I added the result to the world location, so I got a point in which the 'X' axis is the distance from my arm length. I'm not sure, but probably I could just multiply the Arm Length by the world direction and I would get the same result.
Comment
Comment