PlayMaker Help & Tips > PlayMaker Help

Creating a prefab with targets/variables intact

(1/2) > >>

cmart:
Hi folks, I am hoping someone can help me out with a problem I am having. Basically, I want to create a prefab that retains EVERYTHING I set up in playmaker. For instance, I have an enemy with some basic A.I. and player tracking FSMs, and when I duplicate the object in the hierarchy, it works like a charm, all the playmaker stuff works great. But when I try to to take the same object and drag it into a prefab, it copies the majority of the playmaker info but looses all the game object targets and resets (some, but not all, for whatever reason) variables etc.

This is giving me such a headache! It seems simple enough, but I can't figure it out  ???

thanks for any help!

jeanfabre:
Hi,

 you won't be able to retain gameObject references form the scene. That's a limitation in Unity. Now if you loose other variable types values, you should submit a bug to playmaker.

bye,

 Jean

cmart:

--- Quote from: jeanfabre on August 08, 2012, 05:16:18 AM ---Hi,

 you won't be able to retain gameObject references form the scene. That's a limitation in Unity. Now if you loose other variable types values, you should submit a bug to playmaker.

bye,

 Jean

--- End quote ---

Ah, bummer. Thanks for the reply though, not exactly the news I wanted but it is nice to have a definitive answer.

This is more of a general Unity question I thought I might ask while I am here, is there a way to drag a duplicate of an object from the hierarchy into a scene (like you would a prefab from the project explorer). I know you can drag a duplicate from within the scene (control+D) but I have a huge level and there aren't always the object I need to duplicate near by, it would be much easier to drag from the hierarchy..

thanks!

jeanfabre:
Hi,

Yes, prefab instanciation is not really ideal when you start building dense worlds. I have seen projects where several duplicated prefabs with different settings are stored, so if you have for example the same prefab but with three different major variation, drag them back to the project folder as new prefabs.

does that make sense?

bye,

 Jean

Sobek:
Hi

Im having the same kind of problem. I have build up a scene with a player, health_manager, ammo_manager, enemies, bullets etc. It all works perfect.
When the enemies find the player they shoot and decrese his health.
So i made a prefab of the enemie, and a FSM script to tell when and were the prefabs of the enemie will be spawned. And they do spawn. But there FSM script has forgot most of the gameobjects and all variabels they were told to interact with.

I solved there loss of gameobject by simply make a prefab of each gameobject that interact with the enemie, and drag droped each of them into the enemie prefab FSM trought the project panel. So no it dont forget the gameobjects, witch it does if they are drag droped from the hierachy  panel.

But i cant solve it with the variabels sense i cant turn them into prefabs :)

Another thing that is extremly frustating is that when the enemie prefab is shooting at the player, its FSM send a messegae to another FSM within the health_manager and tells it to fire of a dec health event (lower players health), only problem is that the health manager wont fire of the event, even tou its told to do so. If i then replace the prefab with the exact same enmie but not a prefab, it all works great.

i also get this error/ warning (yellow icon) message while run the scene:

 DebugFlow: Missing Cached Variables...
UnityEngine.Debug:LogWarning(Object)
HutongGames.PlayMakerEditor.DebugFlow:Stop()
HutongGames.PlayMakerEditor.FsmEditor:PlaymodeChanged()
UnityEditor.Toolbar:OnGUI()   

Does anyone know how i can get pass this? somehow i have to. I mean i can not possible add 64 enimies at once to each scene, i need prefabs. :/

Navigation

[0] Message Index

[#] Next page

Go to full version