How Do I Use IsOnGround?

I’m trying to determine if a player is on the ground, and I found IsOnGround in the Fort_Character Interface. I tried to perform a check, using the following Verse code, with the intent of injuring players that are on the ground. This would be triggered by a timer:

        Players:[]player := Self.GetPlayspace().GetPlayers()
        for(P : Players):
            if (FortChar := P.GetFortCharacter[]):
                if (FortChar.IsOnGround = true):
                    FortChar.Damage(25.0) 

This line (if (FortChar.IsOnGround = true):slight_smile: is giving me the following error:

This function parameter expects a value of type tuple(comparable,comparable), but this argument is an incompatible value of type tuple(type{_():void},logic)

Can anyone provide me with a proper example of using IsOnGround to determine if a Fort_Character is on the ground? Thanks! :slight_smile:

I found the answer to this problem. The line in question needs to be changed to the following:

if (FortChar.IsOnGround = true):

I’m not sure why, but I know the error went away when I made this change. If anyone can follow behind me with an explanation as to why this works, it would definitely be appreciated :slight_smile:

Hey, this actually won’t quite work! You’ll need to remove the = true part - this documentation should help explain it a bit more: Failure in Verse

1 Like

You are 100% correct. That worked. Thanks! :slight_smile:

1 Like

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