#Jumping not working for my Custom Character State Controller

27 messages · Page 1 of 1 (latest)

graceful glade
#
---LOGIC FOR LANDING AND FALLING---
if newState == Enum.HumanoidStateType.Landed then
            if self:_areMovementKeysDown() or self:_areMovementKeysDown() and self.PlayerStates.Jumping then
                self:ChangeState(self.DefaultMovingState)
                print("LANDED")
            else
                local LandedAnimation = if CombatMode == true then self._loadedAnimations.CombatLand else self._loadedAnimations.Land
                self:ChangeState(landingStateMode)
                self._trove:AddPromise(Promise.fromEvent(LandedAnimation.Stopped)):andThen(function()
                    self:_goToBasePose()
                end)
            end
        elseif newState == Enum.HumanoidStateType.Freefall then
            
            local JumpingAnimation = if CombatMode == true then self._loadedAnimations.CombatJump else self._loadedAnimations.Jump
            if self.CurrentState == jumpingStateMode then
                self:ChangeState(jumpingStateMode)
                self._trove:AddPromise(Promise.fromEvent(JumpingAnimation.Stopped)):andThen(function()
                    if self.CurrentState == landingStateMode then
                        return
                    end
                    if self.CurrentState == self.DefaultMovingState then
                        return
                    end
                    self:ChangeState(freefallStateMode)
                    
                end)
            else
                self:ChangeState(freefallStateMode)
            end
floral nacelle
#

never seen a game

#

look

#

so weird character

#

uh

#

add delay

#

for jump

graceful glade
floral nacelle
#

Oh

#

Diaable

#

U want

#

Stop

#

Hold

#

Sorry didnt see

#

Maybe keep track using userinputservice

#

I dont think u can disable

#

Holding

#

But there other ways with userinputservice

sly compass
#

cast a ray from the characters humanoidrootpart and make the rays length the length of the chatacters hip height

#

if it hits something the character is not airborne

#

you can give the character an airborne attribute or something to replace the humanoid state

#

still weird that it doesnt work

graceful glade
# sly compass still weird that it doesnt work

I think anytime I try to disable the humanoid jump temporarily it just makes me unable to jump, unless I hold the jump key then it just bypasses the jump and goes straight into the falling state without triggering the jump state

graceful glade
#

I wonder if there is another condition I can check, to stop the player from jumping right after they land

gaunt oasis
#

@graceful glade Let's see the front

graceful glade