playMaker

Author Topic: Float Compare Action State Gets Stuck And Im Not Sure Why?  (Read 1207 times)

LuminRabbit

  • Full Member
  • ***
  • Posts: 161
  • Lumin Rabbit
Float Compare Action State Gets Stuck And Im Not Sure Why?
« on: June 13, 2020, 10:43:58 AM »
Hope everyone is having a fantastic day so far!

Don't know if there will be a solution for this could be how Im programming it but I'm using swipe left and right if I do this fast enough the Float Compare Action State gets stuck. Any ideas on how I would attempt to resolve it? Please see image below.

Details of Image:
Swipe left checks the players position and stores it in var currentX, then we move to the Check L state which is a float compare, if currentX Equal to -1.8 return (a way to setup bounds so the player can't move beyond that point and we've hit the max X value for movement) Greater than go to the Move State (the player moves in 1.8 increments so 0 is greater than -1.8), In the move state we are using DoTween to do a Local Move By (so that each swipe can be in increments and movement can be 1.8 each direction (left and right) The same setup is also done for the Move Right.

If this is done repeatedly the Check L or Check R will sometimes get stuck and Im not sure why?
Have I said how much I love playmaker!!! This is one amazing tool

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Float Compare Action State Gets Stuck And Im Not Sure Why?
« Reply #1 on: June 14, 2020, 07:12:56 AM »
Hi.
The Do tween can possibly finish with a value not to the exact value.

While playing and it get stuck, have a look on the value currentX.

Usually when i use tweens, after tweening i do a 'Set Value' (depending which type of value) to make sure its the correct end position/rotation/value.