Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Knuckleup 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?
-
Have you tried using the Edge Collider?
-
Hi.
Are you moving the object that has an animator or do you have a parent to do the movement?
-
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.