playMaker

Author Topic: Float Clamp doesn't work [SOLVED]  (Read 1739 times)

Fleech

  • Playmaker Newbie
  • *
  • Posts: 44
Float Clamp doesn't work [SOLVED]
« on: April 29, 2019, 02:23:43 PM »
my float clamp doesn't work. i've tried putting my float through several operators, applying it to a float taken from another FSM, and a few other things. it has worked in the past but there seems to be only a specific instance where the float clamp actually works. this is extremely frustrating and the float clamps not working breaks many of my FSM's. its especially frustrating because the float is shown as clamped in the inspector, but not in the joint that i'm putting it into. is there another float clamp that overides everything?
« Last Edit: May 02, 2019, 09:22:18 AM by Alex Chouls »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Float Clamp doesn't work
« Reply #1 on: April 29, 2019, 03:43:40 PM »
hi,
Can you show your setup using the float clamp? (fsm/states/actions)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Float Clamp doesn't work
« Reply #2 on: April 29, 2019, 04:55:30 PM »
Something to bear in mind, the execution order of MonoBehaviours on different GameObjects is not guaranteed. This is often the cause of weird issues. E.g., if one FSM clamps a value and another FSM uses that value in the same frame, it might access it before it's clamped.

Not sure if that's what's going on in your case, but it might be something worth looking into...

If you need to guarantee the order of execution you can send an event from the first FSM to trigger the second. Or put the clamp action in the same FSM where you can guarantee the order.

Fleech

  • Playmaker Newbie
  • *
  • Posts: 44
Re: Float Clamp doesn't work
« Reply #3 on: May 01, 2019, 12:25:26 PM »
hi,
Can you show your setup using the float clamp? (fsm/states/actions)

https://imgur.com/a/b2C59dp

the float in question is Div. delta x, its a divided delta angle float. so even though it shows as clamped to its min/max in the inspector, it doesn't clamp that float in the joint that i'm using it for.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Float Clamp doesn't work
« Reply #4 on: May 01, 2019, 02:25:48 PM »
If I'm reading it correctly, it looks like you're clamping the value after it's used to set the joint angle. Try moving Float Clamp before the Set Property actions.

Fleech

  • Playmaker Newbie
  • *
  • Posts: 44
Re: Float Clamp doesn't work
« Reply #5 on: May 01, 2019, 03:03:06 PM »
that did fix it thanks, i forgot that the order of the operations matters.