playMaker

Author Topic: [unsolved] Float Clamp ignoring sign?  (Read 924 times)

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
[unsolved] Float Clamp ignoring sign?
« on: November 26, 2020, 11:19:31 PM »
I'm using Get Rotation on an object, storing it in a float, clamping the float between -30 and 30, and then applying the float to a Set Rotation on another object.

In the order of:
Get Rotation: Y axis = FloatA
Float Clamp: FloatA min=-30 max=30
Set Rotation: Z axis = FloatA

The resulting rotation is *only* positive.  It refuses to use negative values. 
What silly thing have I done this time??  :/

« Last Edit: November 26, 2020, 11:41:22 PM by artician »

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: Float Clamp ignoring sign?
« Reply #1 on: November 26, 2020, 11:30:10 PM »
Used a proxy as suggested by Jean in this older post: https://hutonggames.com/playmakerforum/index.php?topic=13395.msg63700#msg63700

At first it seemed to work, and then suddenly started only providing positive values again.  What the heck??

Some other actions that I've tried:
Get Signed Angle To Target  - Doesn't return any values(?)

Get Delta Angle - Works perfectly.  Float Clamp again ignores the sign, even if the angular value is stored in a proxy variable as Jean's post suggests.

Get Rotation using an Euler Vector 3 - I then store the Y variable from the Vector 3, but Float Clamp discards the sign again, etc. etc.

« Last Edit: November 27, 2020, 12:04:25 AM by artician »

artician

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 318
Re: [unsolved] Float Clamp ignoring sign?
« Reply #2 on: November 27, 2020, 12:19:58 AM »
I was not able to solve the issue with the Float Clamp action, but I did finally get the functionality I was after by using Get Axis action, bypassing the need for Clamp with the multiplier. 

Curious what happened here, but don't really need to worry about it now.