Is it possible to make a full-body animation only animate certain parts of the body at certain times?
I’m incorporating weapons into my game, and that requires the animation attack using a broom. The animation is done, and all it needs is to be implemented in the game. I did this, but I have another concern.
In the animation, all parts of the body are used for the animation. When I’m walking, only the upper body needs to be animated, otherwise it’ll look unrealistic and imperfected.
I’ve tried to just cut the legs from the animation, but due to the rapid movement of the torso it looks too goofy.
If the priority of the walking animation is ‘Movement’ then the animation still overrides them. I can’t tell if this is an animation thing or not though
When animating, try not to animate the legs of the character. Even though the animation will look a little unnatural, the legs will still have a walking animation when the character moves.
I used a method of blending both animations to make it seem seamless. For the server, I roughly had
local function BlendAnimations(fromTrack: AnimationTrack?, toTrack: AnimationTrack, fadeTime: number)
if not toTrack.IsPlaying then
toTrack:Play(fadeTime)
end
if fromTrack and fromTrack.IsPlaying then
toTrack.TimePosition = fromTrack.TimePosition
end
if fromTrack and fromTrack.IsPlaying then
fromTrack:AdjustWeight(0, fadeTime)
end
toTrack:AdjustWeight(1, fadeTime)
end
local function UpdateActionAnim(player: Player, state: string)
local character = player.Character
if not character then return end
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid then return end
local animator = humanoid:FindFirstChildOfClass("Animator")
if not animator then return end
local data = playerTracks[player]
if not data then return end
if data.state == state then return end
data.state = state
if state == "Idle" then
BlendAnimations(data.Upper, data.Full, .5)
elseif state == "Walking" then
BlendAnimations(data.Full, data.Upper, .5)
end
end
AnimationSwitch.OnServerEvent:Connect(function(player, state)
playerStates[player] = state
UpdateActionAnim(player, state)
end)
Client:
--get humanoid and stuff....
humConnection = humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
local isMoving = humanoid.MoveDirection.Magnitude > 0
local newState = isMoving and "Walking" or "Idle"
if newState ~= lastState then
AnimationSwitch:FireServer(newState)
lastState = newState
end
end)