Cutscene on part touch

Hello, I wanted to ask anybody if they knew how I’d go about making a cutscene that several people see at the same time. I’m working on a project where several people can be touched by a zone, and when touched, they get teleported elsewhere, my plan is they drop from a small height and run into a part that then triggered a camera that focuses on the general area and not themselves. Is it possible to do something like this by animating a camera sequence via animator such as Moon Animator 2. I’m new to scripting and this is my first time trying to tackle camera manipulation.

What I’m trying to achieve: When player(s) touch a part, all of their cameras view a cutscene of a focus such as a boss, and then the cutscene ends when the animation ends.

If you took the time to read this and respond, thank you so much for at least trying to help me through this nightmare that is called scripting.

3 Likes

I’d also like to add, I tried to use the plugin called “Otaku Cutscene” and the function that’s meant to play the cutscene when a part gets touched simply doesn’t work, the function for player added works, but touched doesn’t.

Here’s a video that shows how to play a cutscene on part touched. You can get creative with this and make it so the player gets teleported to the part that will play the cutscene, and or animations, etc…

2 Likes

Hello, for the camera, you can tween it. Which is like animation but not keyframes. The camera has a CFrame, which stores it’s position and orientation.

You can tween the camera CFrame to another CFrame like a part’s CFrame, which will give the camera the part’s position and orientation over time, like 1s or 5s.

To make a Tween, first you need the TweenService, the TweenService let’s you create tweens that can the be played. Game:GetService(“TweenSevice”).

You store it in a local variable, for example,

Local tweenService = Game:GetService(“TweenSevice”)

TweenService has a function :Create(), this lets you make tweens. This function takes some parameters,
1). The instance you want to tween.(which is your camera)

2).Info about the tween, like how long it takes(in seconds), there’s other info but get used the time parameter first.
You need a TweenInfo instance for this. Store it in another variable.
Local tweenInfo = TweenInfo.New(1)

3).What properties of the instance you want to tween, like size, Color or your case CFrame. You can also make a table if you want. This parameter expects table.

Make another local variable, this one will store the tween which you can use :play() on. Put in all parameters for the Create() function.

Local myTween = tweenService:Create(Camera, tweenInfo, {CFrame = part.CFrame})

Then you can play this tween and it will move your camera to the part in 1 second. Make sure to reference the part in a variable and also move it to where you want your camera.

myTween:Play()

Make sure to use local script when tweening camera’s because camera is client-side. Reference the camera in local script with workspace.currentCamera

You can then choose when to play this, like when a part is touched.

Give that part a server script and detect when it’s touched, part.touched, then use a remote event to fire to the client that touched the part. Then listen for that remote event in local script and play that tween.

Part.touched is an event predefined by Roblox, a remote event is an event defined by you, you choose when to raise an event and that’s when a part is touched.

I hope you understand what I wrote, it’s a bit rushed. I wish you the best.

1 Like

I don’t know of otaku cutscene but I’m sure TweenService can do the same. PlayerAdded is also an event, you can connect events to functions using the “:Connect(functionName)” or make a function on the spot “:Connect(Function() “code goes here” end)

1 Like

I figured I’d have to do that, but one problem I am having is if I do it that way, the camera has to be in the same place every single time, unless I’m unsure how to do it one way. Is there a way to essentially make the player camera constantly update to the position and orientation to a part? Like updating constantly so I can animate the camera manually?

I already tried that plugin and onPartTouched just does nothing

I think what I mean do is just place a bunch of parts and just tween from 1 to 2 and ect

Try follow this, it has nice functions.

I wanted to come back and conclude that I came to a conclusion for anybody who might see this in the future:

What I did was take a regular part, gave it a humanoidrootpart and turned it into a rig, animated it alongside a character and then when I ran the animation on the camera as well as the character, I used the following code to simulate a cutscene of sorts:

	Cam.CameraType = "Scriptable"
	LiveAnim1:Play()
	game:GetService("RunService").RenderStepped:Connect(function()
		if ActiveCutscene == true then
			Cam.CFrame = CamPart.CFrame
		end
	end)

I hope this helps whoever else may have this question. It fixed my issue, and thank you to @00Stretch and @craftpast for giving me help as well.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.