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

How to use ViewPort Frames?

Asked by 4 years ago

Hi, I was working at a Custom Camera that works with ViewPortFrames. But, this is my first time using ViewPortFrames. I created a code where you can move using WASD QE. It warns the correct CFrame, but the camera stays in the same way. This is the part who don’t work:

coroutine.wrap(function() while true do if KeyHolding == true and type(Key) == 'string' then local X,Y,Z = 0,0,0 if Key == "W" then Z = 0.1 elseif Key == "A" then X = -0.1 elseif Key == "S" then Z = -0.1 elseif Key == "D" then X = 0.1 elseif Key == "Q" then Y = -0.1 elseif Key == "E" then Y = 0.1 end Camera.CFrame = CFrame.new(Camera.CFrame.X+X,Camera.CFrame.Y+Y,Camera.CFrame.Z+Z) Reload() warn(Camera.CFrame) end wait(0.005) end end)()

The Camera’s CameraType is Scriptable.

0
Why is your code written like that? It's pretty hard to read. GGRBXLuaGG 417 — 4y
0
you should practice indentation, makes it easier to spot errors and easier for others to read proqrammed 285 — 4y
0
The problem is with this website, It isn't letting me putting my script. pro_developer213 -5 — 4y

Answer this question