How to add freelook function to stationary weapons
Posted: 2023-09-01 20:48
This is a quick tutorial on how to enable controls to allow you to move the camera with ctrl on a Player Controlled Object/Weapon - transferring the ability from airplanes to enterable weapons like stationaries.
You would need to add in the first paragraph of your code, so under
Then search for 'create Camera', and underneath - add the following code:
The camera will only work on CVM (Camera View Mode) Nose as the free look feature is used for airplanes with CVMNose set as 1 (on).
Applied to stationary vehicles, you are basically setting it to use airplane controls which means inverted controls in the menu will apply to the freelook camera set on stationaries depending on configuration.
You would need to add
Code: Select all
ObjectTemplate.controlsCategory VCAirCode: Select all
ObjectTemplate.seatAnimationSystem xCode: Select all
ObjectTemplate.setMinRotation -125/-20/0
ObjectTemplate.setMaxRotation 125/20/0
ObjectTemplate.setMaxSpeed 90/90/0
ObjectTemplate.setAcceleration 5000/5000/0
ObjectTemplate.setInputToYaw PIMouseLookX
ObjectTemplate.setInputToPitch PIMouseLookY
ObjectTemplate.restoreRotationOnExit 1
ObjectTemplate.toggleMouseLook 1
ObjectTemplate.CVMNose 1
Applied to stationary vehicles, you are basically setting it to use airplane controls which means inverted controls in the menu will apply to the freelook camera set on stationaries depending on configuration.