How would you make a cut scene but with tweening in it?
And if possible, make it loop forever or end when I want it to?
(It’s for an Intro I’m trying to make)
How would you make a cut scene but with tweening in it?
And if possible, make it loop forever or end when I want it to?
(It’s for an Intro I’m trying to make)
Could you elaborate more? You could definitely use TweenService on your UI’s on your intro.
Im talking about using tweening with cutscenes like the camera moves around a certain map but with tweening.
Use Tweenservice to interpolate the camera CFrame, you can either have a set of points to pivot about, or a set of CFrames to tween through in order, and then have the code in an infinite loop, with some break logic.
Relevant link: Customizing the Camera | Documentation - Roblox Creator Hub
If you’re new to messing with the camera, you should read this: Customizing the Camera | Documentation - Roblox Creator Hub
Then you can just use TweenService as others have recommended
I think I recently created something that your exactly looking for or something that is relatively close. I used TweenService, if you want it to loop then you’d just set the TweenInfo to have a RepeatCount of -1 which makes it loop indefinitely.
An example you might be able to put into your own code (this is a LocalScript):
local tweenService = game:GetService("TweenService");
local camera = workspace.CurrentCamera;
local cameraPoints = workspace.CameraPoints; -- this is two parts - 1A, 1B
-- 1A = starting pos, 1B = ending pos
function runIntro()
print("Intro starting!");
camera.CameraType = Enum.CameraType.Scriptable;
camera.CoordinateFrame = cameraPoints["1A"].CFrame;
wait(0.5);
local tweenInfo = TweenInfo.new(
6, -- time
Enum.EasingStyle.Linear, -- style
Enum.EasingDirection.Out, -- direction
0, -- repeat count
false, -- reverses
0 -- delaytime
);
local tween = tweenService:Create(camera, tweenInfo, {CFrame = cameraPoints["1B"].CFrame});
tween:Play()
end
runIntro();
Hopefully, this helped!
-TwoFuse
This is exactly what I was meaning but, 1A Doesn’t seem to be working correctly?
https://gyazo.com/dca2ebd904c63497ea5e084ae4f2e5d2
Its getting the “1A” from the character as the starting posistion rather than the part in the group.
Can you post a picture of your workspace with each of the parts? (Make sure the Explorer panel is in view)
More information in both your thread and responses is required to further assist. Such things include what methods you’ve already employed and a snippet of the code you’re working with, as well as screenshots of anything relevant for us (i.e. object hierarchy).
@TwoFuse Camera.CoordinateFrame is deprecated, just saying.
It looks like it’s setup correctly. Did you change any of the code I posted? I truly don’t know what could be going wrong.
It still works, once it’s completely not working i’ll switch over my stuff. And if it is, what’s the new value for it?
Currently working with his code:
local camera = workspace.CurrentCamera;
local cameraPoints = workspace.CameraPoints; -- this is two parts - 1A, 1B
-- 1A = starting pos, 1B = ending pos
function runIntro()
print("Intro starting!");
camera.CameraType = Enum.CameraType.Scriptable;
camera.CoordinateFrame = cameraPoints["1A"].CFrame;
wait(0.5);
local tweenInfo = TweenInfo.new(
1, -- time
Enum.EasingStyle.Back, -- style
Enum.EasingDirection.Out, -- direction
-1, -- repeat count
true, -- reverses
0 -- delaytime
);
local tween = tweenService:Create(camera, tweenInfo, {CFrame = cameraPoints["1B"].CFrame});
tween:Play()
end
runIntro();
Camera.CFrame.
CoordinateFrame is the long form of CFrame.
Try changing the TweenInfo section on the reverses bool.
Changing it to false doesn’t work.
I think it has to do something with this:
Because if you replace 1B with 1A, it will begin to go to 1A rather than 1B
(Correct me if I’m wrong, still new to scripting)
local tween = tweenService:Create(camera, tweenInfo, {CFrame = cameraPoints["1B"].CFrame});
I to be honest, am not sure of what is happening, when I ran it everything worked successfully. Maybe you can tweak the code a little and get the result you were looking for.
Could you show what yours looks like?
It looked the exact same as yours did.