tag

#camera

12 items (1 guide · 11 fixes)

guides
fixes
26.08.05
"An ICameraModifier writes to every camera that draws, including the editor viewport"

An ICameraModifier runs against every camera that draws, including the editor viewport camera during play-in-editor, not just the camera its component belongs to. A modifier that writes only some view fields makes the viewport obey some instructions and ignore others. A first-person modifier that set view.Rotation but not view.Position froze the editor viewport at the player aim, so a camera tool had its position honoured and its rotation discarded. A transform readback cannot see this, because the override happens later during view composition. Filter every modifier callback to the game view with a check on IsMainCamera.

26.07.08e
"Camera focus target switch causes jerk: smooth the target, not just the follower"

A camera that switches focus target or follow distance on a state change jerks even when position is exponentially smoothed. Smooth the target point and distance separately: the position lerp can't hide a discontinuous input.

26.07.15a
"Chase camera using raw fixed-tick position causes model sawtooth jitter"

A chase camera that reads a raw fixed-tick position field per render frame makes the player model sawtooth side-to-side. Read WorldPosition (context-sensitive interpolated getter) instead.

26.08.05
"Every ICameraModifier runs against the drawing camera, not the one it was authored for"

Every ICameraModifier in the scene runs against whichever camera is currently drawing, in ascending CameraOrder. A second camera inherits every modifier written for the primary one, even though the inspector shows its own transform as correct. Claim the view with your own modifier at a higher CameraOrder than anything else.

26.07.22
"GameObject.Destroy() is deferred: a destroyed object still holds its exclusive claims for the rest of the frame"

GameObject.Destroy() is deferred to the end of the frame, so an object you just destroyed still exists, still answers, and still holds any exclusive claim it owns (IsMainCamera, a singleton slot, a registry entry) for the rest of that frame. Clear exclusive claims on the outgoing owner BEFORE calling Destroy, and never read a leak census in the same frame as the teardown it checks.

26.07.15a
"Joining client's singleton claim grabs the host's character"

A static Instance claimed behind if (!IsProxy) in OnStart grabs the host's character on a joining client: the client camera follows the wrong player forever.

26.07.08e
"Mouse-look camera reads zero from Input.AnalogLook unless cursor is locked"

Input.AnalogLook returns zero (camera never turns) unless the cursor is locked via Mouse.Visibility = MouseVisibility.Hidden -- the deprecated Mouse.Visible = false does NOT lock it.

26.07.08e
"Null check on a destroyed GameObject still NREs: use IsValid()"

A cached Component/GameObject reference guarded with == null still throws NullReferenceException after the object is destroyed: only IsValid() catches destroyed objects.

26.07.15a
"RenderExcludeTags on a tagged parent culls all child renderers too"

GameObject.Tags inherit to all descendants, so a CameraComponent.RenderExcludeTags exclusion on a tagged object culls every child renderer too: cosmetics attached as children silently vanish.

26.07.08e
"ScenePanel Camera is read-only: configure it in place for 3D previews"

ScenePanel's Camera property is GET-ONLY. Assigning a new SceneCamera fails with CS0200. Configure the existing camera in place and build the preview world manually.

26.07.08e
"Spawning a joiner's character clobbers the host's camera target"

On the host, spawning a joiner's character clobbers the host's own camera-target singleton because IsProxy is false at Components.Create time: re-resolve the claim at the first OnFixedUpdate.

Want to know when new guides or fixes drop? Join the community to help build this out. Report gotchas, flag outdated fixes, or just lurk.

Join the Discord