Forum rules - please read before posting.

Infinite jumps

Greetings everyone!
So im having trouble with my jumping. the jumping works fine, exept that i can jump infinite times while airborne, witch makes me literally flying.
I simply just need a single jump at a time.  anyone got any idea for what to do here? :)

Comments

  • I believe you need to be checking if the player is on the floor or not, a simple boolean that is true when the player is on the floor is all you'll need. Then change the jump button so that it only executes the jump when the 'PlayerIsOnFloor' boolean is true.
  • Welcome to the community, @simmyren.

    AC should already make a grounded check for you, but it depends on what components are being used, and the way you've configured your Player component.  In particular, the Ground-check layer(s) field must match the layer that your ground collider is on.

    Please post the full Inspector from your character's root object, it may help to shed some light.  Does the Demo game's player, Tin Pot, work?  You can find out by dropping his prefab (from AdventureCreator/Demo/Resources) into your scene before running.
  • Thaks for the reply! I’ll have a look at it when i get home from work.
  • So i tried messing around with the Ground-check layer(s) and tried everything. do i need to add some sort of a script or collder or simply a tag on my ground objects?

    Here's my character's full inspector:
    image
  • Thank you.  And in what versions of AC and Unity is your project?

    No extra script/tag is necessary on your ground, only a collider that covers it on the "Default" layer.  However, your Player is also on this layer, which may be causing a conflict - try moving it to the "Ignore Raycast" layer (plus any child objects).

    If that doesn't work..

    As this could either be due to your player, or the scene, again try it with the 3D Demo's player prefab.  If he works correctly, but yours doesn't, then the issue will lie with the player.  Conversely, try dropping your player prefab into the 3D Demo scene.  If he then works, then the issue will lie with the scene.  Either way, it'll help us narrow down the problem.
  • sorry for the late reply.
    i've been testing my character in the demo scene.and with the same result.
    tin pot seem to work in my own scene.
  • It sounds like an issue with your player prefab, then.

    You can PM it to me, with graphics/animation included, as a .unitypackage file.  No AC assets should be necessary, but please - again - let me know what AC and Unity versions you are using so that I can accurately test it.
  • Sendt you a pm, im at unity 2017.3.0f3 now, and ac v1.60.7
  • This is due to the character being on the "Default" layer.  Since that's also the "Ground-check" layer, it's creating a conflict.  Move the character to the "Ignore Raycast" layer, and it should be fine.
  • Thanks! problem is solved!
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.