Hi.
I'm trying to make a gun that shoots projectiles.
I've placed the gun in the player's arms on the right of the camera, and now when I shoot a projectile it isn't moving towards the center of the screen (where the player is aiming), but a little bit on the right.
If you don't understand what I mean here's an illustration:
Here's what should happen:
![alt text][1]
Here's what happens:
![alt text][2]
It would be nice if whole arms would rotate in a nice way, so that even if I use a raycast-based weapon it'd look natural.
I've tried using a raycast from the camera towards the camera's forward vector and then using LookAt() on the player's arms, but the arms move in weird positions (for example behind the camera making them not visible).
Please help me, if you know how.
[1]: /storage/temp/110909-2.png
[2]: /storage/temp/110906-1.png
↧