Take the position the camera currently is (The way it is now) and store that position in a set of X/Y/Z destination variables.
Then using something similar to DBPros CurveValue command, (below) interpolate between the cameras current location and the destination location gradually.
`===============================================================================================
`===============================================================================================
`Replacement for the DBPro function of the same name as AGK does not have this functionality.
`Slowly brings float value CurrentValue# towards DestinationValue# in increments of StepValue#
`===============================================================================================
Function CurveValue#( CurrentValue#, DestinationValue#, StepValue# )
StepValue# = Clamp#( StepValue#, 1.0, 100.0 )
Difference# = DestinationValue# - CurrentValue#
Increment# = Difference# / StepValue#
Speed# = CurrentValue# + Increment#
EndFunction Speed#
`===============================================================================================
`===============================================================================================
`Returns Num# as a Float which will not exceed the range of Min# and Max#
`===============================================================================================
Function Clamp#( Num#, Min#, Max# )
RetVal# = Num#
If Num# < Min# Then RetVal# = Min#
If Num# > Max# Then RetVal# = Max#
EndFunction RetVal#
So the code should be something like this:
StepValue# = 50.0 : `Bigger number = smoother transition
CurrentX# = GetCameraX( 0 )
CurrentY# = GetCameraY( 0 )
CurrentZ# = GetCameraZ( 0 )
DestinationX# = WHATEVER YOU CURRENTLY DO
DestinationY# = WHATEVER YOU CURRENTLY DO
DestinationZ# = WHATEVER YOU CURRENTLY DO
NewX# = CurveValue#( CurrentX#, DestinationX#, StepValue# )
NewY# = CurveValue#( CurrentY#, DestinationY#, StepValue# )
NewZ# = CurveValue#( CurrentZ#, DestinationZ#, StepValue# )
SetCameraPosition( 0, NewX#, NewY#, NewZ# )