Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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.

0
Thank you, this is a good answer though I had to make some corrections for it to work more smoothly. robucPleaseMom 24 — 4y
Ad

Answer this question