Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: devis.rossini on July 31, 2015, 10:29:14 AM

Title: Check rigid body position
Post by: devis.rossini on July 31, 2015, 10:29:14 AM
Hi,

In my FSM I have to compute every frame the distance between a rigidbody's position and a given target.

If this distance is equal or greater to the distance of the previous frame, I must trigger an event.

How can I do that? I must wait to the physics update in order to re-compute distance and comprare it with the old one.

Devis
Title: Re: Check rigid body position
Post by: djaydino on July 31, 2015, 02:56:24 PM
Hi,
if you get the distance in a float you can use a float compare
Title: Re: Check rigid body position
Post by: devis.rossini on August 01, 2015, 02:40:57 PM
Yes, but the position is not updated every ::Update(). I should check it during ::FixedUpdate()...
Title: Re: Check rigid body position
Post by: djaydino on August 01, 2015, 02:53:57 PM
Hi,
there is a custom action on the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181) called "RigidbodyTranslatePosition" that seems to work with FixedUpdate.