I’m having issues launching a sphere at certain pitch values. Here is my basic setup:
I have a thirdperson character blueprint with a sphere attached as a spawn point. I’m doing a linetrace from that spawn point and saving the hit actor and hit location. I am then spawning an actor (another sphere) and adding impulse to the actor in the direction of my linetrace.
This seems to work perfectly fine as long as my character is aiming high. But when I aim low the actor is shot at a wrong angle.
I tried inverting the Z value of the lookat rotation and it doesnt work. I tried inverting the z value of the forward vector and it also doesnt seem to work. I’ve used the camera rotation instead of lookat rotation, but nothing seems to work.
What’s more puzzling is that the raytrace location is working, as I’m using the hit location to spawn actors in the world.
Here is my linetrace blueprint:
And here is my code for spawning and adding impulse to the sphere:
Please take a look at this 2min video to see the issue - https://youtu.be/3OSx20RdaEI.
Notice how the ball shoots correctly as long as Im aiming high, but doesnt work when aiming low.
I really appreciate any help I can get on this.