Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Sp00m on April 07, 2014, 10:58:53 PM

Title: Create object as child action??
Post by: Sp00m on April 07, 2014, 10:58:53 PM
I'm creating a game where I need to spawn an object from my assets to my game.

Usually I would use the create object action to spawn the object I need, but that will create an new un-parented game object.

Is there anyway to spawn a game object under a parent object as a child?? If so could someone please tell me how? If there is not a way, is there anyway someone could make a "Create Object of Child" action???

Thanks for the help!! I hope to hear soon!! ;D
~Sp00m

Title: Re: Create object as child action??
Post by: Sp00m on April 08, 2014, 12:28:43 AM
Never mind I figured it out. For anyone who wants to know:
1) You use the set property action.
2) Set the target as the game object you want to be as the child.
3) Under the "property" place set it as tansform -> parent -> Transform (transform.parent)
4) Set the parent game object.

However my problem still exists. This only works with objects that are not prefabs. I'm working with prefabs and it sometimes gives me an errors saying "that prefabs could corrupt the data."???

Anymore help on this??
Thanks!!

~Sp00m
Title: Re: Create object as child action??
Post by: jeanfabre on April 08, 2014, 06:57:54 AM
Hi,

 your problem with prefab is something else, all these actions work with prefabs.

I never had that issue, do you have other errors in Unity console?


bye,

 Jean