Hello, I’m currently working on a game and would like to have an opening cutscene using moon animator, it has an r6 rig (in motion) and a moon animator camera (also in motion).
My only issue is that I can’t figure out how to script it.
I’ve tried looking through youtube tutorials, devforum posts and yet nothing worked.
Any help is appreciated,
AggressiveCIown.
I don’t think you can use the moon animator camera to play in game. You may need to use some camera manipulation to make the cutscene.
local Animator = Instance.new("Animator")
Animator.Parent = RigToPlayAnimationOn.Humanoid
game.Players.PlayerAdded:Connect(function(Player)
if script.Parent:FindFirstChildOfClass("Animator") then
RigToPlayAnimationOn.Humanoid:FindFirstChildOfClass("Animator"):LoadAnimation(AnimationId)
end
end)
If it’s first person, you can weld a camera to the character’s head and use @10kgoldxdrip’s code.
I’ve tried putting this (while changing the necessary code) into the rig, didnt work, then tried putting it into ServerScriptService and that didn’t work. any reccomendations?
This should work, forgot to add the Play function.
local Animator = Instance.new("Animator")
Animator.Parent = RigToPlayAnimationOn.Humanoid
game.Players.PlayerAdded:Connect(function(Player)
if script.Parent.Humanoid:FindFirstChild("Animator") then
RigToPlayAnimationOn.Humanoid:WaitForChild("Animator"):LoadAnimation(AnimationId):Play()
end
end)
Also don’t use the actual Animation Id to replace AnimationId, just put the Animation Object with the AnimationId defined in its properties.
Could you elaborate on this a bit more, this is what i have currently
(the dummy is named “R6”)
Add a animation object and set the animationId in its properties. Then add the animation object as the first paramerer of LoadAnimation
An example picture of what I mean by “Animation Object”
![Screenshot 2022-09-15 150509](//devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/4X/8/8/c/88c21749aae6efe45a825a3ac250e341fe39d7db.png)
still doesnt seem to work
You wrapped animation as a string.
You have to add an animation object. Like how you add a script.
I have. if i remove the quotes it becomes this
![image](//devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/4X/3/9/8/39887c730b89906daf18633a18e8b3a634756246.png)
You need to add a variable that is equal to the animation object. You’re currently just defining a nil value.
did that, red lines went away, animation still didnt play
Set the animationId property, so the animation can actually play.
An example of the Animation property.
![image](//devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/4X/9/8/6/9866feb64b68345b4902b0738b680a62e3d3e9c7.png)
could have sworn i had done that already but apparently i didnt, ill try it and get back to you
getting close, however it spawned in on the very last frame
You could add a delay by using a task.wait when the playeradded event fires.
i think it might be an issue of where the script is, should it be in serverscriptservice, the dummy or where?