I hoped someone here could help me with something that bugs me since a long time.
My character (3rdperson) shoots in the direction I aim. But when I strafe left right while aiming the projectile will go into a different direction somewhere in the opposite of where im walking at.
It just does that one time the moment i turn. After one fail it correctly aims where it should.
[using “get look at rotation” instead of make rot from x doesnt solve the problem]
it seems like the socket location contains some rotation or sth… idk, i also dont know how to use unrotate in this case. i already tried to get socket rotation and unrotate the location and use that, but that gives some very wiered results…
The socket location is in her hand, collision is ruled out as issue (since it would destroy the projectile in her hand and make a hit sound and explode particles etc)
Idk how it could make it shoot so far off since the socket location is a point and the linetrace goes through the camera and the camera is never looking into this direction. It seems like if I issue a move command it thinks im turning the camera (with a huge rotation that I actually never do)
(ps: it also cant have much to do with the aim offset if u think that because this problem existed already before i implemented the offset and the socket was at the head of the character allthough the head turned obviously)
I wonder if it has something to do with the fact that because of where the socket is and how your character moves that socket during strafing, changes the initial direction of the projectile.
It should be using the direction of the cross-hair, but the initial location of the socket. Or something
Edit: this does not work for multiplayer. it works for the server if theres a 0, but not for other numbers, i figured 2 player match with a listen server i could put the number 1 for the second player and it should work, but it doesnt. “screen location” just doesnt work this way on servers, am i right?
i thought TK-master solved the problem, I quote the pm he sent me:
So in case the pic gets taken down someday.
Instead of [CAMERA] ----> [world location] and [world rotation] the following thig accurately returns vectors:
[get player controller] ---->> [get viewport size] booth numbers get divided by 2. Then [convert screen location to worldspace] plug in booth divided numbers from the worldlocation. now theres 2 vectors that work poroperly.
I did not try multiplayer
You can send (from the client to the server) the world location and direction parameters and then do the trace on the server.