[SOLVED] Make Camera.SetAt pan to the target position, instead of jump to it?

Started by barnacleboy, Sat 05/02/2022 21:37:50

Previous topic - Next topic

barnacleboy

It seems like camera.setat jumps to the target coordinates, but I'd like it to pan there (as seen in many games, maniac mansion comes to mind).

For example, player enters a room, then the camera pans to a different part of the room to focus on some action.

Any suggestions?

eri0o

The easiest way to do this is to use the Tween module.

You can get it here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=57315.0

(It's pinned on the modules forum!)

Using that you should be able to simply tween the camera towards your target.

Crimson Wizard

To clarify: what you normally do is save target coordinates in variables, and then move Camera bit by bit until it reaches the saved destination.

For blocking movement you do that in a loop; for non-blocking you have to save coordinates in global variables and move camera in repeatedly_execute (or repeatedly_execute_always).



This is what Tween modules does (and it does many other things too).


SMF spam blocked by CleanTalk