- Joined
- Jul 14, 2004
- Messages
- 463
I have a problem, I want to save the current velocity of the camera movement in a real variable. I wrote this script:
Somehow it doesn't work properly: The speed output is way lower than the speed actually is and the direction is sometimes just zero.
Why does this occur? Any ideas to make a script that works reliable?
Thanks for help,
Waldbaer
Code:
Loop every 0.1 seconds:
set udg_CurspeedCamera[1] = GetCurrentCameraSetup()
//CurrentTargetSpeed Updates
set udg_CurspeedTarget = ( DistanceBetweenPoints( CameraSetupGetDestPositionLoc( udg_CurspeedCamera[0] ), CameraSetupGetDestPositionLoc( udg_CurspeedCamera[1] ) ) * 10 ) //the *10 is to get a value in distance/seconds
set udg_CurspeedTargDir = AngleBetweenPoints( CameraSetupGetDestPositionLoc( udg_CurspeedCamera[0] ), CameraSetupGetDestPositionLoc( udg_CurspeedCamera[1] ) )
set udg_zz_DCCamSystem_CurspeedCamera[0] = udg_zz_DCCamSystem_CurspeedCamera[1]
Why does this occur? Any ideas to make a script that works reliable?
Thanks for help,
Waldbaer