PlayerModule's Popper.lua breaks if workspace.CurrentCamera changes

Popper.lua, found inside Roblox’s default camera controller in the player scripts, contains incorrect logic for binding to the workspace’s CurrentCamera. This logic is important for determining the subject part and subject root part that the camera is focusing on and is critical for popping the camera correctly. Because the module only binds to workspace.CurrentCamera when required, any changes to the property later on can cause major popping issues.

Repro steps:

  1. Enter “Play Solo” on an empty Baseplate
  2. Change the CameraSubject of workspace.CurrentCamera to the Baseplate. This will cause the popper to change its tracked “subjectRoot” to the baseplate and disable popping for it.
  3. Create a new camera and configure it to follow your character (CameraSubject = Humanoid, CameraType = Custom)
  4. Assign workspace.CurrentCamera to this new camera
  5. Since the popper does not bind to this new camera and update its “subjectRoot”, the camera will still not be popped by the baseplate
External Media

Expected behavior

Popper.lua should utilize the observer pattern in order to correctly bind to the current camera’s properties each time it changes.

Thanks for the report! I filed a ticket in our internal database and we’ll follow up when we have an update for you.

This should now be fixed, thanks for reporting this!

Hi, this recent fix seems to have broken something else. I’m currently being spammed with the following error:

Players.swat_department1235.PlayerScripts.PlayerModule.CameraModule.ZoomController.Popper:160: attempt to index nil with 'IsA'
Players.swat_department1235.PlayerScripts.PlayerModule.CameraModule.ZoomController.Popper, line 160
Players.swat_department1235.PlayerScripts.PlayerModule.CommonUtils.CameraWrapper, line 61 - function _connectCallbacks
Players.swat_department1235.PlayerScripts.PlayerModule.CommonUtils.CameraWrapper, line 73

Looks like whichever camera you’re using has an undefined subject as their camera. I’ll roll this change back for now and check whether the subject is defined or not.

1 Like

Thanks for the quick reply. Much appreciated.