Jump and run behavior issues

Maniacus

  • Posts: 69
Ive experimented with the jump and run movement behavior and the jump and run kit. In the kit I only used the walking, jump, and on ground behaviors. I tried them both in a android game with on screen buttons. Ive noticed using both of them that every once in awhile when the level restarts  the actor will either automatically start moving to the left or right and is uncontrollable for several seconds. I didn't change anything in the behaviors and used the on screen buttons behavior. Has anyone else ran into this or know how to fix it? 

Pepperpwni

  • Posts: 1
You are not alone, I am also having this problem.

dreph

  • Posts: 142
If it only happens every once in a while, it could be the logic itself that may be triggering movement.

For me, I get around issues with using the kits by building my own behaviors.  Run/Jump are explained relatively well in Crash Course 2.

Basic Walk:  If left is pressed, move character -x, if right is pressed, move character +x, otherwise, set speed/velocity to 0

Basic Jump:  If jump is pressed, push character towards -y with X force. 

On screen buttons are simple to make, and the behaviors for their regions should be simple enough.  Tapping on screen is like mouse clicks.  so.

For the button itself (if it's an actor):

When created, create region at X + Y of actor (button) with width:  Width of Actor (button) height: Height of Actor (button)

All of that will be jibberish if you haven't done the crash courses, but this forum is helpful with specifics if you need help adjusting code, or have a starting point to work with.