-
What do you want to achieve? I want to make it so a first person animation plays when a player touches a part getting teleported to the first part that plays the animation, and the camera being attached to the player’s head until the animation stops then the player being teleported to another part to end the animation and the camera being back to normal.
-
What is the issue? I can’t seem to figure out how to do it the script won’t work at all, I have been struggling with it for the past weeks, I am very new at scripting etc
-
What solutions have you tried so far? I have looked everywhere and I have never seen anyone talk about it before, I am so clueless at this point since i have seen other games do something similar to that and noone talking about something like this as if its self explanatory.
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Cam = game.Workspace.CurrentCamera
local animationpart = script.Parent:WaitForChild("AnimationPart")
local teleportpart = script.Parent:WaitForChild("TeleportPart")
local humanoid = Character:WaitForChild("Humanoid")
local animator = humanoid:FindFirstChildOfClass("Animator")
script.Parent.Touched:Connect(function()
Cam.CameraType = Enum.CameraType.Scriptable
Character:MoveTo(animationpart.Position)
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://12205528065"
local track = animator:LoadAnimation(anim)
track:Play()
print("Working")
if track.Stopped then
Character:MoveTo(teleportpart.Position)
Cam.CameraType = Enum.CameraType.Custom
end
end)
I have put this as a localscript inside the part
If anyone could help me figure out how to do this I would really appreciate it, I am very new in this whole scripting scene.