Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to successfully play a Moon Animator animation that maniupulates the camera?

Simply doing something like

local player = game:GetService("Players").LocalPlayer
local c = player.Character
local cameraTrack = script.CameraMove --Animation
local cameraPlay = c.Humanoid:LoadAnimation(cameraTrack)

cameraPlay:Play()

does nothing. Previously every other animation has worked with a simple script like the example above. Is there more I have to add since it manipulates the camera?

1 answer

✓ Accepted answer

This isn't for "Moon Animatior", but I'd use TweenService. Try this: (Make it a LocalScript)

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local TweenService = game:GetService("TweenService")
local camera = workspace.CurrentCamera

local info = TweenInfo.new(
	1, -- Time
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local goal = {CFrame = CFrame.new(100, 100, 100)} 

local camTween = TweenService:Create(caera, info, goal)

camTween:Play()

You may change the goal CFrame to whatever you'd like.

1 comment

0

Thank you, this is a good answer though I had to make some corrections for it to work more smoothly.

This discussion is preserved as it was. New answers, comments, and votes are closed.