Skip to content

Tool: Cam Controller

Divran edited this page Jul 18, 2023 · 7 revisions

Tool: Cam Controller

Function Description
Purpose Used to set the view of the owner, or a player in a vehicle.
Primary Fire Places the Cam Controller.
Secondary Fire Links the Cam Controller to a vehicle.
Reload Unlinks the Cam Controller from all vehicles.

Inputs

Input Description
N Activated Turns the Cam Controller on/off.
V Direction The direction of the camera. Either this or the Angle input can be used.
A Angle The direction of the camera. Either this or the Direction input can be used.
V Position The position of the camera.
N Distance The radius of the orbit around Position when client side movement is enabled. If client side zooming is also enabled, this will be the minimum distance you can zoom in.
E Parent Parents the camera to the specified entity. This should almost always be used when you want to make the camera follow your contraption.
N FLIR Setting this to any value other than zero enables a night vision like effect on the user of the cam controller.
N FOV Allows you to change the field of view of the user.

Outputs

Output Description
N On Displays if the cam controller is active or not.
V HitPos Outputs the hit position of a ranger started from the camera's position and directed towards the camera's direction.
V CamPos The camera's position. Especially useful if you have client side movement enabled. However, if you also have client side zooming enabled, the CamPos will be wrong, since the server does not know how much the user has zoomed.
V CamDir The direction of the camera. Especially useful if you have client side movement enabled.
A CamAng The angle of the camera.
XRD Trace Outputs all of the data from the ranger (the same one that outputs HitPos).

Unwanted Side Effects

The camera is lagging behind and not keeping up with the position I want it to be at

Are you trying to make the camera follow a contraption? If yes, stop spamming the position input. Instead, use the "Parent" input on the cam controller, and only set the position once if you can (if you must change the position, you still can, but try not to).

So why does this happen? The reason is simple. When the cam controller was rewritten and made clientside, it was discovered that spamming the position input would cause the camera to spaz and jitter a lot, making it virtually impossible to see anything. To solve this, a smoothing effect was added. When not using the parent input, the smoothing is global, meaning every position change will cause the cam controller to glide to the new position. If you use the parent input, the smoothing effect will instead be local to the entity, meaning the camera will only glide when the position relative to the parent entity is changed.

Trying to make a first person gunner in my contraption, but the aim is off

Anyone who has ever made a gunner on their tank or helicopter, etc, will have noticed that the gunner's eye angles will not align with what that person sees. To fix this:

  1. Check the hide player checkbox
  2. Check the client side movement checkbox
  3. Uncheck the client side zooming checkbox
  4. Parent the cam controller to the chair
  5. Every time someone sits down, set the camera's position to the driver's shootPos (or, alternatively, find out what your shootPos is when sitting down and set the camera's position to that vector once and then leave it.)
  6. You now have a first person gunner that is perfectly aligned with their eyeAngles.

Detailed guide of cam controller options

The cam controller has many options in its context menu. Here is a list of them, and what they do.

Coordinates local to parent

This option determines whether the position and angle inputs on the cam controller are considered to be local to the parent (the input) or global.

Client side movement

This option is probably the most useful. When enabled, it allows the user to move the camera using their mouse, completely clientside.

When using this option, it is recommended to only set the position once, and set the parent. The camera will then follow the parent at that position, while allowing the user to aim using their mouse.

Note:

When client side movement is enabled, the position input changes behavior. You no longer need to position the camera precisely. Instead, simply set the position input to the point you wish the camera to orbit. The player will then be able to rotate the camera around that point using their mouse. When this is enabled, the angle and direction inputs are completely ignored. If this option is disabled, the distance input does nothing. The distance input is used to specify the radius of the orbit. Localized movement This option determines whether or not the client side movement is local to the parent.

Client side zooming

With this option enabled, the client is able to zoom in and out using the scroller on their mouse. The maximum zoom distance is 16000 units (which is almost across the entire map).

Note:

This does nothing if client side movement is not enabled. When this is enabled, the distance input will instead be the minimum distance the user can zoom in. They can still zoom out up to 16000 units. When this is enabled, the CamPos output will be inaccurate, because the server does not know how much the client has zoomed. The ranger output will also be inaccurate for the same reason.

Auto un-clip

When this option is enabled, the camera will automatically try to avoid clipping into walls.

Draw player

This simply hides or shows the player. Useful if you want to position the camera inside the player's face.

Smooth speed

This determines the speed of the smoothing that affects the camera when moving it relative to its parent. This option is client side and personal. Meaning if you change it, you only affect your own speed; and you affect all cam controllers you use.

Expression 2 ⚛️

Tutorials (In learning order) 🎓

Extras ❔

Tools 🛠️

Click To Expand

Advanced

Beacon 💡

Control 🎛️

Data 💿

Detection 👀

Display 💻

Render

I/O 🔌

Physics 🚀

Utilities 🛠️

RFID

Wireless 🛜

Gates 🚥

Click To Expand

TBD

Clone this wiki locally