Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a smooth 2D camera with Scriptable CameraType?

I've seen many 2D cameras using the Attach camera mode, for example, but this game seems to use the Scriptable camera mode, since you cannot move the camera with your mouse.

Although this is pretty easy to accomplish with a while loop, once you start moving it becomes choppy and unpolished because there will always be a 0.03333(etc.) delay between your character moving and your camera changing. That game, however, is not choppy at all. The camera moves at just the same time that the character moves.

I was wondering how the creator did this.

I've also had some trouble with actually getting the camera in the right position, so any tips on that would be appreciated.

1 comment

1

One way to make the camera unable to be used by the mouse is placing a transparent GUI over the entire screen.

1 answer

✓ Accepted answer

To avoid most of the stutter (it depends on the client's gpu. Mine stutters a tonne because I'm using two cards in Crossfire, which introduces the need for vsync, which ROBLOX doesn't support.) you can use the RenderStepped Event of RunService. to run LocalScript code once every graphical frame.

3 comments

0

Wouldn't it cause a lot of lag running that fast though?

0

Depends on what you do inside the loop. If you're just setting CFrame and Camera properties, unless one Client is doing hundreds at once, you're still going to be getting 60+ FPS.

0

Ok thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.