So im trying to get this arrow projectile so spawn in my characters hand and shoot toward the centre of my screen, where my crosshair is pointing. But it seems to be flying in seeminly random directions(sometimes they go sorta straight but that doesnt last long and isn’t accurate).
[This is what it looks like][1]
And this is the shooting function in my main character blueprint
I would just set the rotation based on the camera forward vector rather than tracing behind the cursor for some object that may or may not be there. Just add this vector to your projectile location, normalize, and feed that into your Look At target.
The crosshair and the cursor are not the same. If you set your cursor to be visible you’d see that it’s all over the place and it never stays in the center of the screen.
A standard solution would be to use Line Trace by Channel from the camera, and use its hit result to determine the target location.
You don’t actually need to trace for an object, that’s a very wasteful pattern, all you actually need is the direction of the camera to point your projectile in the right direction.
It’s third person, the rotation of the camera and the direction of the arrow are different because of the camera offset. You want your arrow to fly towards the point at which the camera is directed, not to the same direction as the camera is rotated. And the closer the target to the player, the larger the angle will be. Line trace will ensure that the arrow flies towards the target.
And I can’t really understand your setup. Normalizing a vector will return a unit vector that’s close to zero, thus it’s the point nearly at the world origin. If you use that to Find Look at Rotation, the arrow will always fly to the world origin.
Oops, yes it will fly to the origin with this setup it doesn’t need to be normalized. My point is that you could simply look in the direction of the camera’s rotation from the end of the projectile rather than tracing to the environment for some object directly in front of you.
In that case you can just use Camera Rotation, because with your setup you end up with the Camera Rotation but with extra steps. But again, that would work wrong in a third-person game.