Basically, I have made a model, rigged it and done all the animating aspect of it (rig,humanoid, Root-Part, etc) But now is the hard part, for me at least. Trying to turn it into an animated morph (With variety of animations Run/Jump/Walk/Idle/Swim etc). I have no idea how to do it with the actual animation I have tried to use scripts like these:
wait()
state = {Enum.HumanoidStateType.Running,
Enum.HumanoidStateType.RunningNoPhysics,
Enum.HumanoidStateType.Jumping,
Enum.HumanoidStateType.Freefall,
Enum.HumanoidStateType.Landed
}
-----------EDIT THIS PART--------------
animations = {"678840240", -- Running/Walking
"", -- Idle
"", -- Moving Jump
"", -- Idle Jump
"", -- Freefalling
"" -- Landing
}
---------------------------------------
CurrentState = ""
Animation = ""
canPlay = true
Player = game.Players.LocalPlayer
function playAnimation(Source,animation,player)
if canPlay then
local player = script.Parent.Parent
canPlay = false
local animTrack = Source.Humanoid:LoadAnimation(animation) -- Load animation into Humanoid
canPlay = true
animTrack:Play() -- Start the animation
end
end
local animation = Instance.new("Animation")
local character = Player.Character
local humanoid = character.Humanoid
humanoid.StateChanged:connect(function(old,new)
if CurrentState == "Running" and new == state[3] then -- Moving to Jump
CurrentState = "Jump"
if animations[3] ~= "" then
animation.AnimationId = "http://www.roblox.com/Asset?ID="..animations[3]
playAnimation(character,animation)
end
end
if CurrentState == "Idle" and new == state[3] then -- Idle to Jump
CurrentState = "Jump"
if animations[4] ~= "" then
animation.AnimationId = "http://www.roblox.com/Asset?ID="..animations[4]
playAnimation(character,animation)
end
end
if new == state[4] then
CurrentState = "Falling"
if animations[5] ~= "" then
animation.AnimationId = "http://www.roblox.com/Asset?ID="..animations[5]
playAnimation(character,animation)
end
end
if new == state[5] then
CurrentState = "Landed"
if animations[6] ~= "" then
animation.AnimationId = "http://www.roblox.com/Asset?ID="..animations[6]
playAnimation(character,animation)
end
end
end)
humanoid.Running:connect(function(state)
if state > 3 then
if CurrentState ~= "Running" then
CurrentState = "Running"
if animations[1] ~= "" then
animation.AnimationId = "http://www.roblox.com/Asset?ID="..animations[1]
playAnimation(character,animation)
end
end
else
if CurrentState ~= "Idle" then
CurrentState = "Idle"
if animations[2] ~= "" then
animation.AnimationId = "http://www.roblox.com/Asset?ID="..animations[2]
playAnimation(character,animation)
end
end
end
end)
and even the default one for Roblox. Whilst I am at it, to get the morph to face the correct way do I just rotate the Root-part?
P.S. This was a quick question written in 2 minutes, I will probably come back and edit this
