What Happens:
Whenever the camera’s CFrame is modified every render step it generates HumanoidRootPart velocity regardless of which CameraType or CameraSubject properties are set on the camera.
(The repro file below shows the movement of a camera in “Scriptable” CameraType mode being able to generate enough velocity to fling the character off the baseplate it’s standing on.)
Video:
(Notice the camera is being moved while in Scriptable mode but is still generating character velocity and flinging the spawned character causing them to die.)
Where It Happens:
I have tested and reproduced this bug both in studio and on live game servers.
Repro Place File:
Camera CFrame Bug Demo.rbxl (18.7 KB)
Repro LocalScript:
local runService = game:GetService('RunService')
local playerService = game:GetService('Players')
local player = playerService.LocalPlayer
local camera = workspace.CurrentCamera
local position = Vector3.new()
local function renderFrame()
local distance = math.random(1,400)/100
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = CFrame.new(position + Vector3.new(0, distance, 0), position)
end
runService:BindToRenderStep('render', Enum.RenderPriority.First.Value, renderFrame)
(place in StarterPlayer - > StarterPlayerScripts)
Steps to reproduce:
- Open repro file (attached above)
- Play Solo or Publish and Test on a live Game Server
- Observe your health bar zeroing out as your character is flung off the baseplate by the movement of your camera’s CFrame
- If in studio, observe that the Camera object in the Workspace is set to the “Scriptable” CameraType