playMaker

Author Topic: Float sign test. help with an erratic float.  (Read 3698 times)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Float sign test. help with an erratic float.
« on: May 06, 2015, 03:57:52 PM »
Hi
I have a float variable that fluctuates from negative to positive values and I'm using float sign test to send events when the value is either negative or positive.  Problem is,  sometimes that value can be quite erratic from negative to positive, so how can I control it so is either one or the other? I've tried multiplying it but I still get the same problem. Can someone help?

Harvid

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Float sign test. help with an erratic float.
« Reply #1 on: May 06, 2015, 04:39:38 PM »
You only want positive values ?
if less than 0 multiply by -1
i'm not sure i understand you correctly

« Last Edit: May 06, 2015, 05:18:11 PM by Harvid »

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Float sign test. help with an erratic float.
« Reply #2 on: May 06, 2015, 05:41:52 PM »
You only want positive values ?
if less than 0 multiply by -1
i'm not sure i understand you correctly

No i need both negative and positive.  Its a speed float value i need both for which directing the player is facing. ie negative for left, positive for right.  So at the moment it looks like my player doesn't know which way to face.  ::)

Harvid

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Float sign test. help with an erratic float.
« Reply #3 on: May 06, 2015, 06:49:05 PM »
Are you using GetGameObjectSpeed.cs to measure the speed ?
Think it's maybe issue in local / world space coordinates

just a thought from a Newbie ;)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Float sign test. help with an erratic float.
« Reply #4 on: May 07, 2015, 01:19:47 AM »
Are you using GetGameObjectSpeed.cs to measure the speed ?
Think it's maybe issue in local / world space coordinates

just a thought from a Newbie ;)

Yes I am. I'm using it to get the speed and getting a vector3 from it x

Harvid

  • Playmaker Newbie
  • *
  • Posts: 23
Re: Float sign test. help with an erratic float.
« Reply #5 on: May 07, 2015, 07:28:36 AM »
Jeanfabre has has today made an update of the script so it's contains a option for "self" local axis.
funny we have been struggling with the same problem at the same time  ;)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Float sign test. help with an erratic float.
« Reply #6 on: May 07, 2015, 10:55:01 AM »
Jeanfabre has has today made an update of the script so it's contains a option for "self" local axis.
funny we have been struggling with the same problem at the same time  ;)

Excellent I'll give it a try thanks for the update