Ill explain in more detail here. Is there a way you can make it so when I player touches a part it will start a cutscene using the cutscene plugin. I know how to do that but the part I am asking for is after the player touches the part and the cutscene starts the object in the cutscene lets say a ROBLOX character he will start waving or walking or playing some sort of animation. You should be able to have a command saying if player touched run animation. You know but I am just a little confused I wanna make a cutscene for my game and I was wondering how?
That is pretty simple. You need to use the Touched
event, and bring the animation you have.
Since you will perform camera manipulation along with the animations, a LocalScript
will bring you better results (by eliminating lag)
First, you need to tell the script where are the instances you need to do that animation:
local part = --write here local animation = --write here
Once you get the animation, you should load it into the player. Since it is a LocalScript
, you may use the LocalPlayer
property:
local animationTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animation)
Every part has a Tocuhed
event that is fired when it is touched by something. You can use it then to trigger your event.
Final script
local part = --write here local animation = --write here local animationTrack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animation) part.Touched:connect(function(p) if game.Players:GetPlayerFromCharacter(p.Parent) = game.Players.LocalPlayer then animationTrack:Play() --add more code end end)
Hope I helped!