Jump to content

Camera look around object


Slastraf
 Share

Recommended Posts

Are you looking for the player to rotate this or doing it on your own? This is basically 3rd person camera control with no limitations on it. If you place the camera at the same position as the object it's rotating around, then rotate the camera in whatever direction (x and y usually), then Move() the camera backwards (Move() in LE is relative to the entities rotation so a negative value in the z parameter would move it backwards) then you could get this same effect. It's what a lot of people here do for 3rd person camera functionality. No need for much math at all on your end. Note that you are doing this all in the same frame and you'd keep the rotation value between frames of the camera and just add/sub the value.

 

If you're looking for a nice smooth rotation that the player isn't doing, then look into the lua tween library below, and it gives you that. You'd use it to tween the rotation values over time.

 

https://github.com/kikito/tween.lua

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...