playMaker

Author Topic: Cannot Assign GameObject to Spawn Point[SOLVED!] Answer inside  (Read 2339 times)

QFGlenn

  • Playmaker Newbie
  • *
  • Posts: 30
For about a week I have been tweaking a weapon control system with FSMs and so far everything had gone great til now. All of a sudden all of my Shootpoint empty game objects do not work.

I use Create an object FSM Action. It asks for the gameobject created and then says Spawn Point (GameObject) well I try to drag the shootpoint I have been using all this time and it doesn't work, says Get Property, Set property, send Message.

WTF is wrong? :< This has happened to all the parts of my fsm that use these shootpoints

I have 2 almost identical projects side by side and one accepts game object spawn points and ths other one randomly doesn't and I'm seriously so annoyed at it. Please help me.
« Last Edit: August 12, 2013, 01:12:22 PM by GlennL »

QFGlenn

  • Playmaker Newbie
  • *
  • Posts: 30
Re: Cannot Assign GameObject to Spawn Point
« Reply #1 on: August 12, 2013, 01:11:38 PM »
Support responded via email within 5 hours of my sending them one :)

"Hi Glenn,

So the problem is you're trying to reference scene objects in a Template. A Template is an asset, like a prefab, and in Unity assets can't reference scene objects.

Since Unity won't allow you to drag the scene object into the slot, the UI falls back on the default drag context menu for get/set property. Which is a little confusing! I'll see if there's a better way to handle that situation...

Possible solutions:
- Find scene objects at runtime by name/tag.
- Copy/paste the template into a scene object instead of referencing it.
- Expose variables in the Template using the Inspector checkbox. You can then set these variables on the scene object that uses the template.
- Use a prefab for the manager instead of a template. You can then reference scene objects in the prefab instance.

Hope this helps!

Cheers,
Alex"

It does Alex. Thank you