Jump to content
  • Advertisement
Sign in to follow this  
RutgerKappers

Model moving sideways off camera

This topic is 2444 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 there second post on these forums but i have a rather weird problem. As displayed in the picture below, is how i want a sword to display on the camera even when rotating the camera, however, when i am running on an angle from the forward vector the sword that is suppose to be pinned to the camera slowly slides off the camera.

Here is my update code for the sword position:


position = new Vector3(camera.Position.X + 8f, camera.Position.Y, camera.Position.Z - 20f);


However i feel like this is not properly setting the position of where the sword is suppose to be.

378973_10151052425630257_743435256_21689626_1519994202_n.jpg

Share this post


Link to post
Share on other sites
Advertisement
There doesn't seem to be anything wrong with this line of code. Are you updating the swords positions somewhere else? otherwise, maybe your updating the cameras position after your updating the swords position. If this is the only line of code updating the sword, i'm guessing the problem is your camera. could you post all the lines that update the camera and the sword? and say whether the sword or camera is updated first (although i don't think updating the camera after the sword would cause a sliding effect, but it's good to think of all possibilities)

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!