Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mfost on April 15, 2015, 08:12:57 PM

Title: problem with Get Property
Post by: mfost on April 15, 2015, 08:12:57 PM
I'm working on making an object move to a destination using  Nav Mesh Agent component. The destination is set when the user clicks on a point on the screen. I can get the object to move to the destination with no problem. The problem is with the "Marker" mesh that I have set up as a prefab to be created as an instance game object when the user clicks. The Marker instance runs an FSM state that detects if the player object has reached the end of it's Nav Mesh Agent destination which it uses the get property action to do. If this condition is true the Marker destroys itself. It all works fine until I build the application then the get property action gets set to none and the get & check destination state no longer works.

I have a video in case this is hard to follow:

Is there a workaround to what I'm doing here?
Title: Re: problem with Get Property
Post by: jeanfabre on April 16, 2015, 01:51:05 AM
Hi,

 remaining distance is available as an action on the pathfinding package. try this instead.

https://hutonggames.fogbugz.com/default.asp?W1174

bye,

 Jean
Title: Re: problem with Get Property
Post by: Lane on April 16, 2015, 07:15:10 AM
A Prefab cannot reference a Scene object. This is a Unity limitation and a common oversight.

To circumvent this issue you need to get a reference to the property you want to manipulate at runtime after both objects exist in the Scene. This involves Get Component, and I made a video a while back explaining how it works.