To answer question 1
do is used for localizing things. It creates a scope that will clean up everything at the end of it.
Take this code for example:
local a = 5
do
local b = 4
print(b)
end
print(a)
print(b)
Your output will be:
> 4
> 5
> nil
The do statement starts a new scope, you assign a new local variable ‘b’ and print it, which will print ‘4’ the end statement now ends the scope, so even variables local to that scope, meaning ‘b’ is cleaned up. Printing ‘a’ results in ‘5’ since its in the global scope so its always accessible, but printing ‘b’ again will result in ‘nil’ since that variable only exist in the do-end statement.
For the second one you can probably set the cameras cframe with renderstepped and doing something like
cam.CFrame = cam.CFrame * CFrame.Angles(roll, 0, 0)
(Not sure if that’s the right axis, I can’t check since I’m on my mobile!)
I know, I was surprised too. I got an error using CoordinateFrame doing something recently and checked the wiki and saw that you can just use CFrame anyway.
CoordinateFrame was deprecated a while back, I assume it was for API consistency (having instances have the property “CFrame”, then there’s that one “CoordinateFrame” sticking out).
Off topic (sorry), but can I just say that it’s great to see new users on these forums actually making a contribution and using the forums properly rather than joining the group on Roblox, using it as a badge and never returning to the forums.
I know you’ve been on for a month or something, but it’s still nice to see
Some of these questions the Scripters forum could help me answer though and it doesn’t feel right to post it on the DevForum, but while I’m here, why not.
Also, thanks for the replies to the thread. I’m trying to apply some camera effects to simulate dizziness (whether its a spinning camera or one that loops many rounds in an infinity sign shape).