Replace freefall animation with idle

How do you replace this animation with the normal standing animation?

When the player moves out of the door, EvaluateStateMachine is turned off on the humanoid.

Disable the freefall state
Humanoid | Documentation - Roblox Creator Hub

image
It still doesn’t work, here’s the script.

local humanoid = player.Character.Humanoid
	local character = player.Character
	local righthangblock = guardseat.Value.Parent.HangRight
	if close then
		UnView(player)
		wait(0.1)
		guardseat.Value:Sit(humanoid)
		return
	end
	humanoid.Sit = false
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
	wait(0.1)
	character.HumanoidRootPart.CFrame = righthangblock.CFrame
	humanoid.EvaluateStateMachine = false
	local weldconstraint = Instance.new("WeldConstraint", player.Character.HumanoidRootPart)
	weldconstraint.Part0 = guardseat.Value
	weldconstraint.Part1 = character.HumanoidRootPart
	LeftArmPole(player.Character)

Change the freefall animation Id by the idle animation Id in the “Animate” script and in the values inside it.

2 Likes

a quirky way is to get the characters current playing animation and looking for the freefall animation and simply doing anim:Stop().

altough why dont you add an animation set to action and looping to overlay on-top of the freefall.

1 Like

if he jumps that would make his character look weird.

1 Like

It won’t work, the Animate script will replay the freefall animation instantly.

That’s what he’s looking for so…

1 Like

Can you explain how it gets in this state and what you want it to do? What is holding the character in the air? You want it to float in standing pose?

I don’t understand why the player isn’t falling to the ground at which point it would be standing.

1 Like

It actually only activates if the player’s state changes…

1 Like

Nop it’s a infinite loop that run over 9/s, it check the current humanoid state, do some checks and if the character is in the air, it change the humanoid state back to freefall and play the animation.

1 Like

Here are my rough methods…

Method 1

local humanoid = Character.Humanoid
local animator = humanoid.Animator

local playingAnimations = animator:GetPlayingAnimationTracks()
local freefall = table.find(playingAnimations, 'freefall')

if freefall  then
    freefall:Stop()
end

Method 2

local humanoid = Character.Humanoid
local animator = humanoid.Animator

local animation = animator:LoadAnimation(animationName)
animation:Play()
1 Like

I’ve tried method 1 of this, unfortunately it doesn’t work. I don’t think I understand method 2.

What I’ve done is I disable the sitting property on the player, and then teleport the player to the side position, and then weld the player in its position using a weld constraint. And at the same time, the EvaluateStateMachine property is being disabled on the humanoid to prevent issues with the moving train.

I want the player to just look normal, without free falling. Just in a normal position with it’s hand hanging on the pole (which i’ve already done).

They have some really good documentation on that(I’ve never heard of it):

Perhaps as soon as you teleport the character, you set their Humanoid’s PlatformStand property to true using this line:

character.Humanoid.PlatformStand = true

As soon as they go back in the cabin, set the boolean to false to re-enable movements and animations.

I avoid doing this as it makes the character look inhumane, I believe it disables the players animations and just makes them look like an inanimate object.

I found some documentation here:
https://devforum.roblox.com/t/releasing-character-physics-controllers/2623426

Seems like it should work, the problem is that you’re getting airborne before you disable the ‘statemachine’.

Only, I dont’ know if you’d be able to jump out of the seat if you disable it first, try messing with the order and see if that fixes it.

I disabled it the statemachine before the player got jumped before, the player wouldn’t get out of the seat and instead made the train flip over on its self.

1 Like

You might need to play a ‘stand’ animation in Action mode to override the default then. I guess.

Is this what makes it jump?:

Maybe try setting the state manually right before you disable it:

humanoid:ChangeState(

either Landed, Running, or maybe PlatformStanding

image

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.