Unable to move mouse while right-clicking when CameraType is Scriptable


#21

I believe so, the camera is completely locked no matter what you do. This completely breaks my game (and games that rely on custom camera scripts I would say)


#22

While it may appear to have the same end symptom as the OP’s case, it does help us to know which games are affected, for our QA to regression test them. Sometimes a bug that seems the same as someone else’s can have a different cause (e.g. two or more places in the code that have a similar bug, but in different branches hit by different games). Also, it helps us gauge severity of the issue to know which games are affected, so that we can take the time we need to find all the issues we have to fix, but not leave a flag on that is inconveniencing thousands of players.


#23

Alright, this is my game where it’s happening: https://www.roblox.com/games/973170751/Trainware-Experimental-Lab#!/game-instances

and here’s a simple empty place with just the camera code: https://www.roblox.com/games/1000937559


#24

Ah OK, I see the issue, thanks!

I will take a look at the camera code, because this is also a game I’ve really wanted to play every time you tweet about it, but I’ve never been able to get into the train before. Just now, I was in the cab, looking out of the left window (and of course unable to move the camera). But, prior to this, I’ve tried playing this game several times and have never even gotten in the train before. Normally, after the selection of train, station, platform, I’m left 1000+ studs above the track looking at the red brick, able to pan the camera, but with no working UI and nothing to do except Esc-Leave.


#25

No problem!

And ah yes, that’s one of the most reported bugs the game has received, which will be fixed in an update in the coming days. :smile:


#26

I’m also experiencing problems with the “Watch” mode for scenic flybys of my trains. Instead of staying where the user ‘placed’ the camera, after 2 seconds in, it locks itself facing forward and follows the train and cannot be moved again.


#27

This never happened before it worked perfectly before the update.

I am pulling my head off because of this.

Please can someone confirm that it’s the Update and not my fault?


#28

Are you using Camera:Interpolate? It behaves strange after the update.

I’d recommend switching to using TweenService or a custom interpolation function for now:


#29

Is there any ETA on the fix? I’m kind of trying to push out an update to my game but I’m being held back by this :confused:


#30

The flag will be turned off today, and when it’s turned back on next week it should not recur.


#31

Yes this is the code

					Cam.CFrame = workspace.Desk.CameraStart.CFrame
					Cam.CameraType = 6
					wait()
					Cam:Interpolate(workspace.Desk.CameraEnd.CFrame,workspace.Desk.CameraFocus.CFrame,10)
					wait(9.5)
					for i = 90 , 1 , -1 do
						local NextCFrame = NPCHRP.CFrame * CFAngle
						NPC:SetPrimaryPartCFrame(NextCFrame)
						wait(NPCWait)
					end

Can you provide a sample code or even better implement TweenService or CFrame:lerp() to my script. Thank you


#32

Something like this should work:

Cam.CFrame = workspace.Desk.CameraStart.CFrame
Cam.CameraType = "Scriptable"

local tweenInfo = TweenInfo.new(10, Enum.EasingStyle.Linear)
 
local tween = game:GetService("TweenService"):Create(Cam, tweenInfo, {
	CFrame = workspace.Desk.CameraEnd.CFrame,
	Focus = workspace.Desk.CameraFocus.CFrame
})
 
tween:Play()

tween.Completed:wait()

for i = 90 , 1 , -1 do
	local NextCFrame = NPCHRP.CFrame * CFAngle
	NPC:SetPrimaryPartCFrame(NextCFrame)
	wait(NPCWait)
end

You can find more information about TweenService here.


#33

Good to do this kind of update regardless, because Camera:Interpolate() is on our list of things to deprecate as of the next major update. Camera:Interpolate will still be available for a little while, but since it’s in the C++ camera class, it’s going to be one of those deprecated things that actually does go away, as opposed to just being hidden on the wiki and discouraged. All it does is simple linear interpolation of the camera and focus positions, along with keeping the camera pointed at the focus with each step, using the CFrame look-at behavior that has y-axis polar singularities.


#34

This bug is CRITICAL and is affecting my game Velocity Flight Sim, rendering it completely unplayable within a few minutes - unhappy players are constantly reporting this issue (really bad experience for those just purchasing it as it’s paid access with many demanding refunds for an issue that we neither caused nor can fix).


#35

This bug is also affecting my game and making it unplayable. I thought this would be fixed by now but please fix ASAP.


#36

Still experiencing this issue, and it’s been a week since you posted this. (Sorry if that part sounded arrogant, was just pointing out the amount of time that has passed. I am also aware that it takes time to fix these things) Any update?


#37

Thank you for your patience! It should be fixed for everyone with this coming Tuesday’s update. We elected not to simply turn of the flag globally because the move to Lua-based camera and control scripts is a very important prerequisite for upcoming features and very few places were seriously affected, only a handful of games with the magic combination of setting the camera type to Scriptable, using mouse input to control the custom camera, and also having the default Roblox camera scripts enabled and running. There shouldn’t be anything wrong with this, it should have worked as it always did whether the Roblox cameras are being used or not, but there is a bug in the Lua implementation specific to Scriptable. Impact was low only because most games with Scriptable-based custom cameras are either disabling the Roblox camera scripts entirely with an empty, disabled, or replacement CameraScript local script in StarterPlayerScripts, or the Scriptable type is only being used when the camera is not being directly controlled by user mouse input (e.g. kill cams, cut scenes, static shop views / 3D UI views, etc.)

For the impacted places that were called out above or sent to me via DM, I had the flag turned off selectively. It does take approximately a week for a fix of this nature to be live; it’s important to do the QA due diligence for player scripts, because they are used by more than 99% of Roblox games, so a fix made in haste could easily turn a bug affecting 8 games into one affecting thousands of games and millions of players.


#38

@Coeptus @AllYourBlox

It’s still happening

I use the Exact same code provided and it’s still broken !!!

Video

Before it broke

I use Roblox Video Recorder to Record both Videos, and the script works smoothly in game it’s the Recorder causing the Video to Stutter.

@Coeptus you are awesome for providing me with the script.
Maybe this time we can try CFrame:Lerp() ?


I didn’t posted it after the reply from Coeptus because I thought it would work fine and then I just found out that it doesn’t. :sob:

I hope this will be fixed soon @AllYourBlox , I also DM you the details a week or two ago but you never replied.

I’m just going to work on other stuff for now.


#39

No problem :smiley:

Are you sure you’re using the updated camera scripts? If you have older versions saved in StarterPlayerScripts, the camera might not work properly.


#40

As noted above, the bug fix should be live with the next update (6/19). We selectively disabled the flag for public places developers reported as seriously affected. This is so the developers would not have to republish live games just to patch this. For any private places under development that are blocked by this, you can copy the camera scripts into your game and find the two references in RootCamera’s UpdateMouseBehavior() to LockCenter and LockCurrentPosition and exempt them from Scriptable. For example, changing

UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter

to

UserInputService.MouseBehavior = (game.Workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable) and Enum.MouseBehavior.Default or Enum.MouseBehavior.LockCenter

or the equivalent if-then structure. And the same for LockCurrentPosition.