Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Pan camera around player

Author
Message
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 1st May 2023 15:36 Edited at: 1st May 2023 15:37
Ok so I am rotating my camera like this, but it stays behind my player constantly.

I want a smooth pan around gradually as my player turns. I for the life of me cant grasp how to do this.

hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 1st May 2023 19:37
The smoothing can be done by interpolating between the player y angle and the camera's current y angle each frame before moving the camera back on it's z axis. Here's an example that uses a dummy object as the camera's "parent" (the interpolation is done on this object instead of the camera) and SetCameraLookAt() to point at the player.

Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 1st May 2023 20:09
Thank you for the response, I will use this in my project.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 2nd May 2023 03:44 Edited at: 2nd May 2023 03:49
nice, hendron.

consider posting the code in Code Snippets? make sure to use [AGK] in the title if you add it or any other gems like this.

so much good code throughout the forums that needs to be reviewed vs asking some of the same questions again and again.
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 2nd May 2023 04:09
Yes I have seen that a lot of problems I am having in my 3d games is No one asked or showed how to do what it is I might need, I believe this is because I am working on a third person 3d game.

Not including some questions as like arrays as I learned that I should have learned how to put together arrays in the first place lol.

If I can not fix any problems And can not find a answer and the answer is not in the help documentation then I ask or beg sometimes lol.

I think that if I ask or anyone else does and someone gives a good answer to a problem, it should be updated in the examples in the help documentation.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 2nd May 2023 15:32
Quote: "consider posting the code in Code Snippets? make sure to use [AGK] in the title if you add it or any other gems like this. "


Sure thing, posted.

Login to post a reply

Server time is: 2024-11-23 08:17:20
Your offset time is: 2024-11-23 08:17:20