Forum rules - please read before posting.

Player Grounded

edited April 2020 in Technical Q&A

Hi,

I would like to set in script the player isgrounded would be true without ground/terrain collision. So an example:

When I jump down from an airplane, when my player reaches an "y" value in the air (without ground collision, so f.e.: on the half way), I would like to change my player's animation. I try to looks the docs, but no success. Can you help me, please?

Thank you in advance!

Comments

  • AC's internal record of "is grounded" is handled automatically - but you don't have to use it if you don't want to. You can instead create a custom bool parameter in your Animator (e.g. "IsGroundedCustom") and use that instead.

    To have this parameter value change based on the Player's position, you could attach a script or just have the Player enter a Trigger that runs a Character: Animate Action.

  • It doesn't work. I have to use "is grounded", because if I go on the terrain and jump, I start to walk in the air without it.

    The question is that, can I send a message to the system "Is grounded" happened? (when I'm in the air)

  • Not to the internal record, no - again, this is handled automatically.

    You can, however, wire up your Animator Controller to rely on "IsGrounded" normally, but "IsGroundedCustom" (or some other Animator parameter) during this specific sequence.

    e.g. If IsGrounded = false, but IsGroundedCustom = true, transition to the new animation.

  • Yes, I tried it already, but it didn't worked good, because sometimes stucked.

    I made a trick, when I reach that point in the air, I instantiate a sphere with trigger collider (with Terrain layer) inside player collider, and after I destroy it with on collisionenter void. Now, its perfect.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.