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

How do I make cutscenes using CFrame?

Asked by
p0vd 207 Moderation Voter
5 years ago

So i've been always wanting to make cutscenes, but I really don't know how to make them. I've looked at a bunch of YT tutorials but there either not what I want, or they are outdated. For example, in Super Roblox 64 Adventure (miss that game btw) in one of the bosses they had an epic cutscene in the beginning. (Link if you want to see the cutscene: https://www.youtube.com/watch?v=JGYTnRrpTuM) I want to make something like that but in my own style.

1 answer

Log in to vote
0
Answered by
Lugical 425 Moderation Voter
5 years ago
Edited 5 years ago

Before we Start... You need to know about cameras. When you play a game on Roblox, your character is the center of attention for you. It's focused to your player. The reason this is so is because of your player's Camera. On each client, there's a different camera. It's parented to the client's version of Workspace, and to reference a client's camera, simply do the following in a LocalScript

local cam = game.Workspace.CurrentCamera --Call on client's camera.

With that, we've referenced the camera, and we can begin on cutscenes.

Method: Interpolation Camera Interpolation is a function you can use with the player's camera. It has 3 arguments, you need to put into it: the CFrame, the Focus, & a time interval. What it does with these two arguments is that it'll adjust the camera's current CFrame and Focus to the ones you place, taking as long as your time interval. With Interpolation, the camera moves at a steady rate, similar to the Linear EasingDirection. Judging on your video, the game featured there is likely using interpolation. Other games that may possibly use interpolation (with observation) are Survivor (with challenge cutscenes) and Jailbreak (with the beginning screen overlooking the city).

Assuming we're on the same LocalScript as the one before, let's add onto it with an example of Interpolation!

local cam = game.Workspace.CurrentCamera --Call on client's camera.
wait(10) --For this example, we're just gonna wait so the character can load in.
cam.CameraType = Enum.CameraType.Scriptable
cam:Interpolate(CFrame.new(0, 0, 0), CFrame.new(0, 1, 0), 1)

What we did here is simply interpolate the player's camera to the CFrame of (0,0,0), Focus of (0, 1, 0), (making it look directly up) while taking just 1 second. We also changed the CameraType to Scriptable, so we're able to edit the camera. While the LocalScript does change the camera, we haven't edited the CFrame and Focus before, so it's going to start right from the player's character, to those points. However, I doubt that you wanna start right from the player. Therefore, we need to edit this script, so instead of starting from the player, we can start from another CFrame and Focus, like a cutscene. Here, you can diverge into 2 ways.

--WAY 1
local cam = game.Workspace.CurrentCamera --Call on client's camera.
wait(10) --For this example, we're just gonna wait so the character can load in.
cam.CameraType = Enum.CameraType.Scriptable
cam:Interpolate(CFrame.new(0, 1, 0), CFrame.new(0, -1, 0), .05)
wait(.05)
cam:Interpolate(CFrame.new(0, 0, 0), CFrame.new(0, 1, 0), 1)

With this way, you can just copy and paste your other Interpolation and edit the arguments. Here, I put the time interval ".05", so it gets to these points almost instantly! However, make sure you put a wait(timeInterval), so the actual interpolation (cutscene) can start at the right points.

--WAY 2
local cam = game.Workspace.CurrentCamera --Call on client's camera.
wait(10) --For this example, we're just gonna wait so the character can load in.
cam.CameraType = Enum.CameraType.Scriptable
cam.CFrame = CFrame.new(0, 1, 0)
cam.Focus = CFrame.new(0, -1, 0)
cam:Interpolate(CFrame.new(0, 0, 0), CFrame.new(0, 1, 0), 1)

This method doesn't do the copy paste as before, but rather, define the starting points outright. Here, we see the CFrame and Focus being adjusted almost instantly (and technically, about .05 seconds faster than the former). After that, the interpolation will start, beginning your cutscene. You can edit these arguments and place them to your heart's desire to make some good cutscenes!

Notes:

  • ALWAYS set the CameraType to Scriptable before changing anything about the camera, or else errors will occur!

  • Interpolation takes these 3 arguments in this order: CFrame, Focus, timeInterval.

  • If you want to bring the camera back to the player, change the CFrame and Focus to the player, and then set the camera back to Custom.

0
I already know what the basics of camera, I just need help on cutscenes. Thank you for the help btw! p0vd 207 — 5y
Ad

Answer this question