Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Fleech on April 29, 2019, 02:23:43 PM

Title: Float Clamp doesn't work [SOLVED]
Post by: Fleech 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?
Title: Re: Float Clamp doesn't work
Post by: djaydino on April 29, 2019, 03:43:40 PM
hi,
Can you show your setup using the float clamp? (fsm/states/actions)
Title: Re: Float Clamp doesn't work
Post by: Alex Chouls 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.
Title: Re: Float Clamp doesn't work
Post by: Fleech 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.
Title: Re: Float Clamp doesn't work
Post by: Alex Chouls 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.
Title: Re: Float Clamp doesn't work
Post by: Fleech on May 01, 2019, 03:03:06 PM
that did fix it thanks, i forgot that the order of the operations matters.