Hi! If you could help that would be great! I was wondering how I would make my fps arms play an animation such as idle, and an animation when a user clicks.
I have a model named “Arms” in ReplicatedFirst and a script in startercharacter scripts.
local player = game.Players.LocalPlayer
local camera = workspace.Camera
local run = game:GetService("RunService")
local arms = game.ReplicatedFirst.Arms:Clone()
run.RenderStepped:Connect(function()
arms:SetPrimaryPartCFrame(camera.CFrame * CFrame.new(0,-2,0))
end)
arms.Parent = camera
The code above works and the fps arms are viewable to the player. My only question is how would I make it so the arms play an animation? Help would be appreciated thanks!
So funny occurrence how I just finished animating my arms,
But basically you firstly need your arms rigged and animated from blender, you can see the tutorials needs on youtube as this is just too long to explain in a single post.
Once you exported you animation from your FPS arms you create an animation in the arms and set the AnimationId to the Animation you created.
Make sure theres humanoid inserted into the arms as that will let us actually play the animation.
From the following code inserted in a local script you should be able to load the animations and play them:
In this instance the local script is inside the Arms Model
local Animation = script.Parent.Animation.AnimationId
local LoadedAnimation = script.Parent.Humanoid:LoadAnimation(Animation)
LoadedAnimation:Play()