So ive been trying to make a game and i need help with touch dialogue and cutscene. I’ve been searching in youtube and i cant find the right tutorial. So basically i want to make a dialogue when player touch a part and there will be cutscene that move to different position. So maybe you can show me a script of how to do it or maybe send a video that show the tutorial.
Oh i already see that but i need it to be moving to other positions not just stay
You can use tweenservice to move the camera!
example below shows you how tweenservice moves the camera between points in a collection:
local camera = workspace.CurrentCamera
local ts = game:GetService("TweenService") -- ts = tweenservice, not typescript
local tinfo = TweenInfo.new(1)
-- the camera will move to the point in exactly 1s, quadratic with no reverses or
--repeats
local points = {
CFrame.new(10, 10, 10),
CFrame.new(50, 50, 50),
CFrame.new(0, 0, 0),
}
local function moveCamera(point: CFrame)
local tween = ts:Create(camera, tinfo, {CFrame = point})
tween:Play()
tween.Completed:Wait()--yield thread before going to next point in list
end
camera.CameraType = Enum.CameraType.Scriptable--make the cam editable
for _, point in ipairs(points) do--for each point in the list, move the camera to its
--position, change the rotation of the cframe to include rotation aswell.
moveCamera(point)
end
camera.CameraType = Enum.CameraType.Custom--reset the cam after it has ended
--this will not automatically reset when the player dies.
This is a basic example, but it should give you an idea on how to move the camera.
if you want the camera to move somewhere when a part is touched, you’d check for touches and move the camera if so.
then the only thing you’d have to do is sync the dialog with camera movements.
Hope this helps!
Yoo thank you for the help man ill try it tomorrow and ill see if it works or not i appreciate the helps man
hey i already try it but the camera is a bit weird
can you tell me how to fix it cuz im not really familiar with cutscene stuff??
why is there a google drive link?
cutscene is about moving the camera, you move the camera using some simple steps:
--1 add references
local cam = workspace.CurrentCamera
local ts = game:GetService("TweenService")
--2 set cam to a modifyable cam type
cam.CameraType = Enum.CameraType.Scriptable
--3 create, and play your tween with the given goal
local tween = ts:Create(cam, TweenInfo.new(1), {CFrame = CFrame.new(255, 255, 255)})
tween:Play()
--4 optional, wait if multiple movements
tween.Completed:Wait()
repeat the steps above to move the camera from its current cframe to the desired cframe.
here is a simple cutscene that I made:
here is the source, it is very badly written, but i did it quickly because it is an example:
--server
local cam1 = workspace.camPos1--a part with the desired start position
local cam0 = workspace.camPos0--a part with the desired destination
local init = workspace.init
local infinite = false--debounce
init.Touched:Connect(function(hit)
if infinite then return end--avoid playing again
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if not plr then return end--check if the collision was with a player
infinite = true--set debounce to true to lock the cutscene and avoid playing it again
game.ReplicatedStorage.remote:FireClient(plr, cam0.CFrame, cam1.CFrame)--a remote
task.wait(8)--this is for effects, moving the rig after the cam is done moving
workspace.Rig.Humanoid:MoveTo(workspace.walkpoint.Position)
workspace.Rig.Humanoid.MoveToFinished:Wait()
end)
--client
local cam = workspace.CurrentCamera--camera
local tweens = game:GetService("TweenService")--tweenservice for animation
local remote = game.ReplicatedStorage:WaitForChild("remote")--the remote
local function moveCamFrom1To2(cframe1, cframe2)--both cframes
cam.CameraType = Enum.CameraType.Scriptable--set to editable type
local tween = tweens:Create(cam, TweenInfo.new(8, Enum.EasingStyle.Linear), {CFrame = cframe2})--create a cframe with desired args, the cam, and the goal
cam.CFrame = cframe1--set cam's cframe to the start cframe
tween:Play()--play it
end
remote.OnClientEvent:Connect(function(cframe1, cframe2)
moveCamFrom1To2(cframe1, cframe2)--call the play func
task.wait(6)--this is for timing, effects etc
local doortween = tweens:Create(workspace.door, TweenInfo.new(2), {Size = Vector3.new(2.5, 1, 12), Position = Vector3.new(-70.75, 13.75, 2)})--create an anim, for the door opening
doortween:Play()--play it
doortween.Completed:Wait()--wait for it to finish
task.wait(3)--wait a bit more
game.Lighting.ColorCorrection.Enabled = true--make the screen black
cam.CameraType = Enum.CameraType.Custom--cutscene over? reset camera!
--give the cam back to the plr, so the plr can control it once the scene is over!
end)
hope this does it
used objects that might need a more detailed explanation:
Camera | Documentation - Roblox Creator Hub
TweenService | Documentation - Roblox Creator Hub
RemoteEvent | Documentation - Roblox Creator Hub
TweenInfo | Documentation - Roblox Creator Hub
CameraType | Documentation - Roblox Creator Hub
if the docs are a bit too complicated, you can always ask me for a better explanation, or just copy paste in ai with the prompt: “explain like i’m 5”
Alr thanks!
And i have to use google drive cuz the file cant be load so i have to use another way. Ill take a look at it and ill inform you later!
Hey i wanna thank you for helping me! it works and I start to understant a little bit about the cutscene thing!