PlayMaker Feedback > Feature Requests
Template reference and Global reference to hierarchy gameobjects[SOLVED]
(1/1)
djaydino:
Hi,
I wanted to use a template for some enemy behavior but i have a refference to a "Enemy Manger" GameObject which holds several array list.
But this breaks because the template thinks its a prefab and Can't refer to hierarchy objects.
So then i thought to make a global and reference that, but there i cant drop them in neither
even if one of the 2 would work, it would enhance the template a lot.
Another possibility would be to have the ability to place a template inside an fsm
as if it was a state, similar to grouping a bunch of states (another requested feature)
also for Globals this would be very nice as you could easier set references using its global variable instead of dragging and dropping the gameobject
jeanfabre:
Hi Kurt :)
yeah you can't reference scene objects in a template that you'll run using runfsm, but using global variables works, can you show me with screenshots or screencast what's wrong? my tests worked.
Bye,
Jean
djaydino:
Hi jean :)
Global variables work except for "gameobject" variable i can't drop in a gameobject from the hierarchy
For the template i am not using run fsm, but i place them in an fsm
and it has a local int variable that has 'inspector' checked and i set a index number for each object.
Then that index number is used to get info from several arraylist arrays, on a 'array manager' fsm.
But i found a work around and already to solve this.
by getting the gameobject @runtime
jeanfabre:
Hi,
yes, because you can't reference a GameObject of a scene inside an asset that doesn't reside in the scene.
the only way is that if you use this template to run an entire fsm, expose this as inspector and wire these gameobjects then via the inspector on the instances inside your hierarchy, OR set them up at runtime using logic.
Bye,
Jean
djaydino:
Hi,
Ah yes, that would indeed break the global.
Anyway i have set it up with some logic @ runtime
to make it easier to duplicate for my client and still be able to change things inside the template when needed :)
Navigation
[0] Message Index
Go to full version