generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Stop the ability to move your camera?

Previous Thread :: Next Thread 
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 11:02 AM
How do you make it so you can't scroll out or move your camera temporarily? I am trying to make a cutscene.
Report Abuse
DoctorBloxor is not online. DoctorBloxor
Joined: 07 Feb 2012
Total Posts: 3222
20 Jul 2015 11:09 AM
Make a gui that contains a frame.
Make sure the frame covers the entire screen (You can make it transparent, so you don't see it).
Then make it Active.

You will no longer be able to move your camera.



Nope.avi
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 11:20 AM
I did that. When the cutscene is activated, I made the script make the frame active, and at the end of the cutscene, I make the frame inactive again. It is totally transparent but I can still move my camera and scroll out.
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 11:21 AM
Does the frame need to be selectable or something?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 11:22 AM
workspace.CurrentCamera.CameraType=Enum.CameraType.Scriptable
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 11:24 AM
bloxor's solution is lazy and outdated
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 11:26 AM
I'm getting somewhere with what you said lolb3 (it won't allow my camera to move), but the cutscene won't play. Here is the script if you need it:

function onTouch(part)
local g = game.Workspace:getChildren()
for i = 1,#g do
if g[i].className == "Camera" then
if g[i].CameraSubject == game.Players.LocalPlayer.Character.Humanoid then
game.Workspace.Camera.FieldOfView = 30 -- Cool cinematic effect
game.workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
--game.StarterGui.StopMotion.Frame.Active = true
g[i].CameraSubject = game.Workspace.Cutscene1
wait(0.1)
g[i].CameraSubject = game.Workspace.Cutscene2
wait(0.1)
g[i].CameraSubject = game.Workspace.Cutscene3
wait(0.1)
g[i].CameraSubject = game.Workspace.Cutscene4
wait(0.1)
g[i].CameraSubject = game.Workspace.Cutscene5
wait(0.1)
g[i].CameraSubject = game.Workspace.Cutscene6
wait(0.2)
g[i].CameraSubject = game.Workspace.Cutscene7
wait(0.2)
g[i].CameraSubject = game.Workspace.Cutscene8
wait(0.2)
g[i].CameraSubject = game.Workspace.Cutscene9
wait(0.2)
g[i].CameraSubject = game.Workspace.Cutscene10
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene11
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene12
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene13
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene14
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene15
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene16
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene17
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene18
wait(0.3)
g[i].CameraSubject = game.Workspace.Cutscene19
wait(1)
g[i].CameraSubject = game.Workspace.Cutscene20
wait(10)
--game.StarterGui.StopMotion.Frame.Active = false
game.workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
g[i].CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.Camera.FieldOfView = 70
script.Parent:Remove()
end
end
end
end
script.Parent.Touched:connect(onTouch)
Report Abuse
EvanHolt is not online. EvanHolt
Joined: 06 Sep 2008
Total Posts: 1264
20 Jul 2015 11:33 AM
First, use game.Workspace.CurrentCamera to get the camera in a localscript rather than using a for loop.

Then, instead of assigning the camera subject, assign the camera's CoordinateFrame, like this:

game.Workspace.CurrentCamera.CoordinateFrame = CFrame.new([position where the camera will be], [position the camera will look at])

[ George Orwell taught me math! 2 + 2 = 5 ]
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 11:38 AM
oh wow alright. So the way you're doing your cutscene is by looping through objects to attach the cam to. When you're doing stuff that's longer, like even 10 seconds, it'll be a lot more efficient, smoother and less laggy to use camera:Interpolate()
From the wiki;
Interpolate ( CoordinateFrame endPos, CoordinateFrame endFocus, float duration )
Smoothly tweens the camera from the current coordinate frame to the supplied one with the given focus over the duration.

So you'll do kinda like

cam:Interpolate(CFrame.new(20,20,20),CFrame.new(20,10,20),5)

This will smoothly move the camera to 20,20,20 while shifting the camera's focus to look down at the point 20,10,20

Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 11:44 AM
I'll try that, but just in case I can't manage to get that to work (since I am a beginner scripter), how would you just be able to change the cameratype to scriptable and still have my cutscene play as it is?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 11:50 AM
cam.CoordinateFrame=cutscenewhatever.CFrame

i have a better solution for you.

function onTouch(part)
local g = game.Workspace:getChildren()
for i = 1,#g do
if g[i].className == "Camera" then
if g[i].CameraSubject == game.Players.LocalPlayer.Character.Humanoid then
game.Workspace.CurrentCamera.FieldOfView = 30 -- Cool cinematic effect
game.workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
--game.StarterGui.StopMotion.Frame.Active = true
for c=1,20 do
g[i].CoordinateFrame = game.Workspace["Cutscene"..c].CFrame
wait(0.1)
end
--game.StarterGui.StopMotion.Frame.Active = false
game.workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
g[i].CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.Camera.FieldOfView = 70
script.Parent:Remove()
end
end
end
end
script.Parent.Touched:connect(onTouch)


Also this won't work in normal mode, so I suggest splitting the local stuff into a different script which you then clone into people, or you put this all in a local script and index the brick in workspace instead of as script.Parent
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 12:45 PM
Thank you sir. Just in case you would like to know, this was my completed script.

debounce = false
function onTouch(part)
local g = game.Workspace:getChildren()
if debounce == true then return end
debounce= true
for i = 1,#g do
if g[i].className == "Camera" then
if g[i].CameraSubject == game.Players.LocalPlayer.Character.Humanoid then
game.Workspace.CurrentCamera.FieldOfView = 30 -- Cool cinematic effect
game.workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
for c=1,14 do
g[i].CoordinateFrame = game.Workspace["Cutscene"..c].CFrame
wait(.2)
end
g[i].CoordinateFrame = game.Workspace.Cutscene15.CFrame
wait(12.2)
game.workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
g[i].CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.Camera.FieldOfView = 70
script.Parent:Remove()
end
end
end
end
script.Parent.Touched:connect(onTouch)
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 01:01 PM
couldn't get interpolate to work? Oh well. It is a multitude smoother though.
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 01:04 PM
I'd like it to, but I am not sure how to apply it to my particular location and cutscene preferences. I'm very new to scripting so I'm not too good with advanced stuff like that. :/
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 01:20 PM
basically cam:Interpolate(workspace.Cutscene15.CFrame,workspace.Custscene15.CFrame,1)

Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 01:26 PM
Do I need to set cam as a variable, or is that just built-in to the system or something. And could I literally just copy and paste that into the script to make it work or would I need to set values?
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 01:34 PM
oh sorry yes just change cam to whatever your variable for Currentcamera is. I think it would work.
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 01:55 PM
I tried...it didn't work. I'm probably just applying it wrong.

debounce = false
function onTouched()
if debounce == true then return end
debounce= true
game.Workspace.CurrentCamera.FieldOfView = 30 -- Cool cinematic effect
game.workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera:Interpolate.(workspace.Cutscene15.CFrame,workspace.Custscene15.CFrame,1)
game.workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
game.Workspace.Camera.FieldOfView = 70
script.Parent:Remove()
end
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 02:02 PM
so look you're trying to index the arguments of the function with the interpolate. I think I might have done that - sorry.


game.Workspace.CurrentCamera:Interpolate(workspace.Cutscene15.CFrame,workspace.Custscene15.CFrame,1)

fixed
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
20 Jul 2015 02:03 PM
dont forget to reset your debounce too
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
20 Jul 2015 02:08 PM
The script removes its parent at the end so that doesn't matter.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image