Cinemachine cameras lose Follow/LookAt target after runtime player spawn #35
Labels
No labels
architecture
bug
duplicate
enhancement
help wanted
invalid
performance
quality
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lavarius/ProjectOverlay#35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Cinemachine virtual cameras that previously had a direct scene reference to the player's
Transform(Follow / LookAt) lose that reference when the player is instantiated at runtime (spawned), resulting in cameras that no longer track the player.Root Cause
Scene-serialized object references to the player are
nullafter spawning because the player GameObject no longer exists as a pre-placed scene object — it is instantiated dynamically.Proposed Fix
Add a small
CinemachineTargetBinderMonoBehaviour to each virtual camera that needs to track the player. OnStart(or whenever the player is spawned/ready), the script:"Player"or a singleton reference).TransformtoCinemachineVirtualCamera.Followand/orLookAt.If the player spawns asynchronously, the binder should listen to a spawn event/callback instead of relying on
Starttiming.Acceptance Criteria
CinemachineTargetBinderscript created and attached to all relevant virtual cameras.