playMaker

Author Topic: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit  (Read 5779 times)

derkoi

  • Full Member
  • ***
  • Posts: 187
Hey guys,

I'm trying to set the Quarry target of the Unitysteer - Steer for Pursuit class to the player object with a "Detectable Object" script on it after the Enemy prefab has been spawned using playmaker. The spawning is working great.

Problem is, I can't add the player game object via set property as it wants a type of "detectable object" on it. See attached image.

Any ideas how I can get around this?

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #1 on: June 26, 2012, 05:34:29 AM »
Anyone?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #2 on: June 27, 2012, 01:37:46 AM »
Hi,

 Had a look: The quarry must have a "Vehicle" component attached, so anything using the class "Vehicle" will work there.

for example, create a gameObject and drop the AutonomousVehicle component ( in the behavior folder), then you can drag that as the quarry for your SteerforPursuit component.

 Bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #3 on: June 27, 2012, 01:49:33 AM »
Thanks for the reply. The prefabs do have all the scripts needed.

I tried what you said & it didn't work as it needs the component of DetectableObject (like in the screenshot) and Playmaker won't let me drop my player object with the DetectableObject on it as it will only let me put a type of game object on it.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #4 on: June 27, 2012, 02:17:50 AM »
hi,

 What version of UnitySteer do you have? This is odd I have a different set up it seems.

 Bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #5 on: June 27, 2012, 02:38:09 AM »
v2.5b1

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #6 on: June 27, 2012, 05:14:30 AM »
Ok got the right version now :)

 it works tho. You do need the "Detectable Object" component or any component implementing this class.

so, make sure that the prefab you have spawned do feature this component, else it won't work allow it.

 Bye,

 Jean


derkoi

  • Full Member
  • ***
  • Posts: 187
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #7 on: June 27, 2012, 03:43:41 PM »
Hmm, can you please run it by me how you're setting this up. Here's what I am doing:

I have a Player gameobject with a detectable object script attached to it in the scene, no spawning.

I have an enemy prefab with the AutonomousVehicle and Steerforpursuit scripts attached. I spawn these using playmaker which works perfectly.

I added a SetProperty to the enemy and dragged the steerforpursuit component to the Setproperty then selected Quarry.

I then try to drag my player object in to the Quarry slot but it won't let me.  ???

Thanks again for your help.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #8 on: June 28, 2012, 01:31:50 AM »
Hi,

Odd.. It's likely because you do not have a "detectable Object" on the gameObject you are dragging. Double check that ( triple check maybe :) )

If not, I am not sure, cause it's working well here.

Are you using prefabs? you get get mixed up with this. It's all happening in the scene hierarchy right? you are not trying to reference a gameObjecto on the prefab itself right?


bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #9 on: June 28, 2012, 02:39:59 AM »
Yes i am using prefabs for the enemy. I dragged a prefab to the hierarchy and dragged the Player object to the Quarry and it works but how can I spawn enemy prefabs that target the Player? I'm confused.  ???

Maybe add a fsm to all spawned prefabs at runtime?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #10 on: June 28, 2012, 03:25:46 AM »
Hi,

ok, that'll explain, and you would encounter this even without unitySteer, it's simply a unity restricition that you can't reference scenes elements within a prefab during editing.

 Several possible ways, when you spawn the ennemy, you can send him an event with the player reference int he event data, else the ennemy can "find" the player. else make the player reference a global variable.

 bye,

 Jean

derkoi

  • Full Member
  • ***
  • Posts: 187
Re: PlayMaker & Unitysteer - Setting Quarry in Steer for Pursuit
« Reply #11 on: June 28, 2012, 03:28:19 AM »
Thanks.

I think for now I'm just going to add the enemies to the hierarchy & randomise their start up location at runtime.

Thanks again for the help.  :)