• Advertisement
Sign in to follow this  

Need help with gun direction

This topic is 4378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I am making a FPS weapon. The gun it´s placed correct on screen but the guns look direction isn´t working, it´s allways facing the same direction. I tried to calculate a direction from the guns position to the cameras look at and set it to the gun, but it doesn´t seem to work. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Moved to GP&T - seems like a more general graphics issue to me...

Some more information might well help people help you -

1. Are you creating the gun's transform in world space, camera space or possibly screen space?

2. by "always facing the same direction" do you mean that when you rotate your player/camera the gun doesn't follow?

Depending on the information you have available, working out the angles between the gun's model-space axis and the view direction might be the place to start. I also find that drawing out diagrams on a piece of paper helps put these sorts of mathematical problems into context [smile]

hth,
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement