playMaker

Author Topic: Get Distance doesn't work~![SOLVED]  (Read 4210 times)

Ouren

  • Playmaker Newbie
  • *
  • Posts: 11
Get Distance doesn't work~![SOLVED]
« on: July 25, 2014, 10:31:43 PM »
Here's an MP4 of the issue:
http://i.gyazo.com/f5bc1f0e51130df59cb2cf9727030f62.mp4

¯\_(ツ)_/¯

Enemy FSM is "Get Distance" from itself to the PlayerHolder (the thing moving in the scene!)
« Last Edit: August 01, 2014, 06:16:51 AM by jeanfabre »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Get Distance doesn't work~!
« Reply #1 on: July 26, 2014, 12:13:17 PM »
Maybe something else is using the Distance variable? Setting it to the value you're seeing...?

Ouren

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Get Distance doesn't work~!
« Reply #2 on: July 26, 2014, 05:41:42 PM »



Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Get Distance doesn't work~!
« Reply #3 on: July 26, 2014, 06:12:25 PM »
Any chance you could email me the project?

Ouren

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Get Distance doesn't work~!
« Reply #4 on: July 26, 2014, 09:35:47 PM »
Sure!~

EDIT:
Done

Ouren

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Get Distance doesn't work~!
« Reply #5 on: July 30, 2014, 02:30:50 PM »
You get a chance to look over it?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Get Distance doesn't work~!
« Reply #6 on: July 30, 2014, 11:52:52 PM »
The problem is PlayerHolder is a prefab, not an instance of the prefab in the scene. The prefab asset doesn't move, so GetDistance doesn't change!

This comes up a lot with Unity. In the next update I'll look into adding an error when actions should point to a scene object and not a prefab. Most actions should point to a scene object. FSMs on a prefab can also point to child objects of the prefab and these references should get properly remapped (by Unity) when the prefab is instantiated in the scene.

A quick way to see if a referenced GameObject is a prefab or scene object is to press the select icon next to the edit field (circle with dot). This opens the object browser and you can see if the GameObject is an Asset or Scene object. Clicking the edit field will also ping the asset in either the Project or Hierarchy windows, depending on if it's a prefab or a scene object.

rik

  • Full Member
  • ***
  • Posts: 246
Re: Get Distance doesn't work~![SOLVED]
« Reply #7 on: March 07, 2015, 05:31:35 PM »
Hi i was having get distance problem i have make sure i was not using prefab i have removed the prefab associated with the fsm