Forum rules - please read before posting.

SamplePlayer3D not trigging "Land" parameter

I've just imported Adventure Creator in another project and I've noticed the Sample Scene with the SamplePlayer3D prefab, the Animator's "Land" parameter is never being triggered. I haven't changed anything with this scene or this prefab. Is this is a known issue?

Comments

  • The Land trigger's invocation is currently based on the difference height between the Player's Y-positions before/after being in mid-air.

    You can adjust this in the Player Land component, but currently a jump on a flat surface won't invoke Land because this height difference will be zero. I'll adjust it so that it's instead based on the difference between the apex of the mid-air position, and their land position, so that it can be enabled for this situation. Thanks for detailing.

  • Thank you. I anticipate there would be quite a few use cases where folks would jump on a flat surface like a floor, a road, the inside of a house or a factory, etc. Is there a temporary code-fix I could perform to remedy this now?

  • Replace its Update function with this, and then reduce the "Height Threshold":

    private void Update ()
    {
        if (player.IsGrounded ())
        {
            float heightDiff = lastGroundedHeight - player.transform.position.y;
            if (heightDiff >= heightThreshold  && !isPlayingAnim)
            {
                StartCoroutine (PlayLandAnim ());
            }
            lastGroundedHeight = -Mathf.Infinity;
        }
        else
        {
            if (player.transform.position.y > lastGroundedHeight)
            {
                lastGroundedHeight = player.transform.position.y;
            }
        }
    }
    
  • edited June 2024

    That does now initiate the landing animation and triggers that parameter. Thank you so much for taking the time to do this. It did introduce another bug though in that I can now double jump in the air...so there may be some conflict/bad timing with the transitions in the current Animator I'm using.

  • edited June 2024

    One issue I've discovered is I have no option to zero out Jump Speed. For instance if I want to remove all jumping, I'd zero out that speed and I cannot. So it seems my option may be hacking it by setting an unusually high simulated mass and lowering Jump Speed to 1.0? Or perhaps removing the Jump input assignment?

  • It did introduce another bug though in that I can now double jump in the air...so there may be some conflict/bad timing with the transitions in the current Animator I'm using.

    Physically double-jumping, or just playing the jump animation in mid-air? I can't recreate either with the Sample Player.

    Or perhaps removing the Jump input assignment?

    Removing the Jump input assignment is the intended way to disable jumping altogether. To disable it temporarily, use the Player: Constrain Action.

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.