Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RedFTiger

rotating a player

This topic is 5464 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

I have a enemy that i want to rotate to face the player. since i only wanted to rotate on the y axis i got the angle between the enemys view and players position and made that the new angle for the enemy. this works when i move in one direction but when i go the opposite direction the rotation dosent change it just keeps rotating in the same direction constantly

Share this post


Link to post
Share on other sites
Advertisement
Check if the angle you''re getting is > 180 degrees, and if so, rotate the other way 360 - x degrees.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!