Forum rules - please read before posting.

First person movement - Infinite jumping problem

edited September 2018 in Technical Q&A
Unity ver: 2018.2.2f1
AC ver: 1.64.1

Hello folks,

I've noticed my first person character can constantly keep jumping. So just by pressing space constantly you go higher and higher.

I don't recall there being much setup for jumping, but here are some of the things that seem connected.


InputManager setup:



Player prefab:


Any advice about where to start looking to fix this?

Comments

  • On Discord someone suggested it might be related to layers. Currently everything in my game (player prefab, world meshes...etc) are set to 'default' layers.
  • If your Player is on the Default layer, then it's likely conflicting with its own "ground check", which you've set to also be on the Default layer.  Try moving the Player onto a separate layer.
  • I've set the player prefab to now use a layer called 'Player'. By doing that, jumping is entirely disabled.

    My results so far are:

    If layer is set to 'default' - you can jump upwards infinitely
    If layer is set to 'Ground' - you can jump upwards infinitely
    If layer is set to 'Player' - jumping is disabled

    image
  • Please show the full Inspector - I need to see all the components that you're using.
  • Of course, here you go sir. The full inspector for the player object:

    image

    image

  • 1) Your Capsule Collider does not appear to have it's base at the root position, but beneath it instead - either set the Centre Y to half the Height, or the Height to double the Centre Y.

    2) You have three custom scripts attached - remove them for the moment to make sure they aren't contributing.

    3) Do you have any more colliders on child components that are on the Default layer?

    4) Drop Tin Pot into the scene to override your own Player - does he exhibit the same issue?
  • Tin Pot works fine. Having a play around with things now.
  • Fixed! It was down to the state of the capsule collider. Tweaking that fixed everything.

    image

    The left version was the one which was causing problems. The base of the capsule you can see is under the floor. Moving it upwards, (on the right) fixed things.
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.