playMaker

Author Topic: 2D Player Getting Stuck While Moving [SOLVED]  (Read 1620 times)

Knuckleup

  • Playmaker Newbie
  • *
  • Posts: 14
    • Sugarhigh Shakedown Dev Blog (A love letter of tragedy to beat em ups)
2D Player Getting Stuck While Moving [SOLVED]
« on: May 07, 2018, 09:48:54 PM »
Not sure why it's doing this, but my 2D player hits the ground, but I have to almost double tap and hold the button down to make him move left or right.  Sometimes he goes and sometimes he doesn't.
I checked to make sure I have one single box collider along my entire ground made up of separate sections (shaped in a large rectangle).
I have a Box Collider and a Circle Collider (along with a rigidbody 2D attached to him as well.  Circle Collider only takes up a portion of the legs to the bottom of the feet.
Box Collider goes from waist up to tip of head.
I have a Movement FSM Movement/Flip Left Event (goes to Flip Left/Finished State and the Flip Right to Flip Right State / Both Finished states return back to Movement State) 
Movement State has in order:
1.Get Axis Action(Axis Name: Horizontal) /Multiplier: 2.5 / Store: xSpeed (Every Frame Checked)
2. Set Velocity 2d Action: Game Object: Owner / Vector X and Y:0 /X: xSpeed / Y: None
3. Get Key Down Action: Key: D / Send Event: Flip Right / Store Result: None
4. Get Key Down Action: Key: A / Send Event: Flip Left / " "
5. Set Float Value Action: Float Variable: Par_Speed / Float Value: xSpeed / Every Frame Checked.
6. Float Abs Action: Float Variable: Par_Speed / Every Frame Checked
7. Set Animator Float Action: Game Object: Owner / Parameter: H_Speed/ Value: Par_Speed / Damp Time: 0 / Check Every Frame (On Update)

The Animations are working when I jump-land-run...it just that the player gets stuck and then I have to hit or double tap again and he moves a bit. 
I just want to be able to hold the direction and he runs and then stops when I let go.   Any suggestions?
« Last Edit: May 13, 2018, 10:47:35 PM by Knuckleup »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: 2D Player Getting Stuck While Moving
« Reply #1 on: May 09, 2018, 05:58:24 PM »
Have you tried using the Edge Collider?
Available for Playmaker work

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: 2D Player Getting Stuck While Moving
« Reply #2 on: May 10, 2018, 07:30:58 AM »
Hi.
Are you moving the object that has an animator or do you have a parent to do the movement?

Knuckleup

  • Playmaker Newbie
  • *
  • Posts: 14
    • Sugarhigh Shakedown Dev Blog (A love letter of tragedy to beat em ups)
Re: 2D Player Getting Stuck While Moving [SOLVED]
« Reply #3 on: May 12, 2018, 04:14:35 PM »
Thanks for the replies, much appreciated. I restarted the project, but imported the sprites leaving all defaults except of course, making it Point instead of biliniar.  I left it at 100 for size even though each sprite is 128x128.  That’s the only thing I did different, besides restarting and it took. 

Only glitch I have now is when I jump the player goes to jump animation and then to fall animation, which is fine.  However, in the animator I have Any State connected to Fall state so if I fall off an edge, it should trigger the fall animation with Y velocity set and not tagging a “ground” object, but doesn’t.  Oh well, least of my worries.
« Last Edit: May 12, 2018, 11:03:10 PM by Knuckleup »