Aim to crosshair Is it even possible?

Hello!

I try to made a similar aiming system, what we see in MGSV. Everithing seems fine, until I switcxh weapons. I want the different weapons to point to the same location when i switch between them. I made a fix point, made the aim offset with all poses, but the aiming is not correct. how to make a correct aiming?

If this is the worng way, how to make aim poses, that points to the same spot?

Thanks for any help!

Are you referring to the animations being all wonky or to the fact that your projectiles arent going where you want them to?

Thanks for your answer!

I made actor for the weapons, and attach them to a socket on the player character.
I add line trace to the weapons, and draw the crosshair to the end (impact point, or end of trace, if no hit occurs).
My problem begins here.
The player has different poses for the pistol aiming and the rifle aiming.
When I switch weapons, the other weapons crosshair is not where the previous was, and not pointing to the same spot.
This happens due to the different poses, so I want to set up the poses to correct this.
I want to know, how I can set up the pose for the pistol aiming and the rifle aiming to make this working.
Now I use the mixamo rifle and pistol aim poses, but this is the problem with the animation starter pack too.

Cant really help you with the animation side except to tell you to either try blending or manually adjusting the aim angles.

If you dont mind things working fine but looking weird, you can;

  1. Raycast from camera to crosshair when you fire the weapon.
  2. Get location of the collision
  3. Use that location as the target for your projectile (vector math maybe involved here)

This MAY cause your bullets to fire at weird angles from the barrel of the gun (depending on what your animation looks like). You can sorta fix this by adding a local rotation to your gun mesh so that it aims at the target point at all times (animation blending will look cleaner and more natural here).