playMaker

Author Topic: 2D Platformer-Getting GameObject to not move.  (Read 863 times)

Mudman94

  • Playmaker Newbie
  • *
  • Posts: 3
2D Platformer-Getting GameObject to not move.
« on: April 04, 2020, 12:03:54 AM »
Hello, I am making a 2D Platformer and am working on a death state when colliding with an EdgeCollider. I use SetVelocity 2D and set X to 0 however the GameObject can still move on the Edge before the FSM is finished and the game restarts. Once it has restarted it works as intended with the GameObject unable to move. I'm not sure how to remedy this but any help would be greatly appreciated.

I added two screenshots of where I use SetVelocity 2D, hopefully that might show the error.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: 2D Platformer-Getting GameObject to not move.
« Reply #1 on: April 04, 2020, 04:01:15 AM »
Hi.
you should disable the axis, you setup is probably overriding the set velocity to 0.

on the fsm with the axis setup make 2 global events.
add one to the start state to enable axis, and make 1 empty state add the other one to disable.

Have a look at this video about transitions :


Mudman94

  • Playmaker Newbie
  • *
  • Posts: 3
Re: 2D Platformer-Getting GameObject to not move.
« Reply #2 on: April 04, 2020, 08:57:21 PM »
Thanks so much that worked perfectly!!!