Hello,
I am hoping someone could tell me how to modify this code so I can limit the viewing angle +- 45 degrees along the x-axis. This comes from Dark Physics.
` rotate and position the camera based on the box controller
position camera object position x ( 3 ), object position y ( 3 ) + 30, object position z ( 3 )
rotate camera object angle x ( 3 ), object angle y ( 3 ), object angle z ( 3 )
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = wrapvalue ( CameraAngleY# + mousemovex ( ) * 0.1 )
CameraAngleX# = wrapvalue ( CameraAngleX# + mousemovey ( ) * 0.1 )
yrotate object 3, curveangle ( CameraAngleY#, OldCamAngleY#, 6 )
xrotate object 3, curveangle ( CameraAngleX#, OldCamAngleX#, 6 )
If the player object(3) is limited to rotating between +- 45 degrees, so should the camera which is attached to it. I thought it would be as simple as limiting CameraAngleX# to a wrapvalue of 45 but this doesn't seem to work. The curveangle parameters are (destination angle, original angle, transition speed). As an example, if the OldCamAngleX# and CameraAngleX# are 0, and the mousemovey value increases, so should CameraAngleX# by its wrapvalue. The player object(3) should now rotate along the x-axis its curveangle (which is the transition distance between the OldCamAngleX# and "updated"CameraAngleX#)So if the xrotate object can be limited to +- 45 degrees, this might solve the problem. If I were to take the wrapvalue of the curveangle and limit the curveangle to 45 degrees...I don't know. I could use some help. Thank you.