Removing the mouse lock when pressing right click, while allowing the camera to rotate while holding it

This is probably a silly question, and I’m likely to be overlooking something, but I’ve been looking for several posts but all threads I can find always point out to completely disabling the right click functionality of the camera with the “Sinking” of the input.

ContextActionService:BindActionAtPriority("RightMouseDisable", function()
	return Enum.ContextActionResult.Sink
end, false, Enum.ContextActionPriority.Medium.Value, Enum.UserInputType.MouseButton2)

However this isn’t what I am looking for. I’m trying to make it so, when right clicking, and holding it, the camera orbits around the avatar. This behavior can be found in the “UGC Homestore” template included in Roblox Studio, but I can’t figure out how it’s done.
I’ve looked through the scripts, and I couldn’t find anything related to it. I’ve looked at the camera settings but they’re all on their default settings, and there’s no forking involved that I can see, which has me puzzled.

When you tap shift with ShiftLock enabled, the cursor still moves, and when right clicking, the mouse cursor turns into a cross (+), which usually would leave it locked in the center of the screen, but in this template it doesn’t.

I’ve also tried to disable the mouse locking behavior through pure brute force like so:

UserInputService:GetPropertyChangedSignal("MouseBehavior"):Connect(function()
	if(UserInputService.MouseBehavior ~= Enum.MouseBehavior.Default) then UserInputService.MouseBehavior = Enum.MouseBehavior.Default; end
end)

But this causes the camera to not spin as well, and it’s even worse than the input sinking method.

How can I replicate the camera behavior from the Roblox Studio template, or which script is causing it?

You’re trying to manually control the camera behavior, but Roblox already has built-in camera systems for this. The right-click orbit behavior is part of the default camera system, so it’s not something you need to script yourself. You’re overcomplicating it by trying to disable and force things, when the behavior you want is already there by default in certain camera modes.

It doesn’t matter which camera mode or controls I use in the Roblox’ default “UGC Homestore” template, though. The mouse doesn’t lock at the center of the screen and I can freely move it around.

How can I replicate that?

You need to use a custom camera script that lets the camera orbit when you right-click without locking the mouse. Roblox doesn’t do this by default, so you need to add or use a special script for it.