playMaker

Author Topic: Float Compare "Equal" [SOLVED]  (Read 4383 times)

Abdou23

  • Playmaker Newbie
  • *
  • Posts: 30
Float Compare "Equal" [SOLVED]
« on: August 27, 2014, 03:09:07 PM »
The "Equal" condition doesn't seem to work at all, i have a platform that i want to move up & down, so i get it's position then compare it with the position i want it to stop at then move the other way,  when i use "Equal" it just keeps moving indefinitely, but when i use "Less than" or "Greater than" it works but not accurately and it's kinda clunky way. 
« Last Edit: August 27, 2014, 04:35:02 PM by Lane »

bizilux

  • Full Member
  • ***
  • Posts: 171
Re: Float Compare "Equal"
« Reply #1 on: August 27, 2014, 03:16:12 PM »
ur tolerance is probably set too low, and in that frame that it checks, its already past tolerance, so it wont fire equal event...

float compare can be hit or miss... if you need really precise point at where it needs to stop, it is impossible to do it as far as i tried... but for ur platform it might be okey...

i tried making oldschool mario like controls with raycasts... impossible with float compare since its just not accurate enough

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Float Compare "Equal"
« Reply #2 on: August 27, 2014, 03:18:21 PM »
Floats have 7 digits in them and Float Compare is looking at explicit equality. It's unlikely that you'll hit a position within precision of 0.00001...

You might consider increasing the tolerance, or using triggers, or making a step based FSM where it moves X amount, then X amount after that is done.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Abdou23

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Float Compare "Equal"
« Reply #3 on: August 27, 2014, 03:23:48 PM »
Floats have 7 digits in them and Float Compare is looking at explicit equality. It's unlikely that you'll hit a position within precision of 0.00001...

You might consider increasing the tolerance, or using triggers, or making a step based FSM where it moves X amount, then X amount after that is done.

ur tolerance is probably set too low, and in that frame that it checks, its already past tolerance, so it wont fire equal event...

float compare can be hit or miss... if you need really precise point at where it needs to stop, it is impossible to do it as far as i tried... but for ur platform it might be okey...

i tried making oldschool mario like controls with raycasts... impossible with float compare since its just not accurate enough


Tolerance = 0, tried changing it but it either has no effect, or the platform doesn't move at all.

If there is an action to move object to position in specific amount of time that would would be great.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Float Compare "Equal"
« Reply #4 on: August 27, 2014, 03:25:37 PM »
You can use the iTween actions for that.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Abdou23

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Float Compare "Equal"
« Reply #5 on: August 27, 2014, 03:35:28 PM »
You can use the iTween actions for that.

Only itween action i could find is "MoveTo" - "MoveUpdate" both requires fixed vector. i just need to specify single X,Y because i can't keep making different variables for all the platforms in the game.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Float Compare "Equal"
« Reply #6 on: August 27, 2014, 03:36:11 PM »
Try MoveBy
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Abdou23

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Float Compare "Equal"
« Reply #7 on: August 27, 2014, 03:46:57 PM »
Try MoveBy

This works, but it's kinda complicated action with several unused options. We just need one with built in axis, time, and finishing event.  :)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Float Compare "Equal"
« Reply #8 on: August 27, 2014, 03:50:01 PM »
You can use the checkbox on the bottom of the action stack to Hide Unused fields.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Abdou23

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Float Compare "Equal"
« Reply #9 on: August 27, 2014, 04:04:55 PM »
You can use the checkbox on the bottom of the action stack to Hide Unused fields.

Not just for organisation , but i wonder how much does this action affect the overall performance.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Float Compare "Equal"
« Reply #10 on: August 27, 2014, 04:13:02 PM »
Tweens can be somewhat expensive to use in the first place (mostly for mobile devices), but the actions are designed to not be wasteful. If you aren't using particular features of an action then its not going to bother processing those parts.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Abdou23

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Float Compare "Equal"
« Reply #11 on: August 27, 2014, 04:25:35 PM »
Tweens can be somewhat expensive to use in the first place (mostly for mobile devices), but the actions are designed to not be wasteful. If you aren't using particular features of an action then its not going to bother processing those parts.

Good to know, I'm creating a mobile game, will try to minimise the use of those actions as much as i can.

 Thank You for you help :)