playMaker

Author Topic: problem with Get Property  (Read 2187 times)

mfost

  • Playmaker Newbie
  • *
  • Posts: 1
problem with Get Property
« 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: problem with Get Property
« Reply #1 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

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: problem with Get Property
« Reply #2 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.

Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D