Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 10 years ago

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
One way to make the camera unable to be used by the mouse is placing a transparent GUI over the entire screen. RoboFrog 400 — 10y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

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.

0
Wouldn't it cause a lot of lag running that fast though? ZeptixBlade 215 — 10y
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. adark 5487 — 10y
0
Ok thanks ZeptixBlade 215 — 10y
Ad

Answer this question