playMaker

Author Topic: Create object as child action??  (Read 2222 times)

Sp00m

  • Playmaker Newbie
  • *
  • Posts: 5
Create object as child action??
« 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


Sp00m

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Create object as child action??
« Reply #1 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15496
  • Official Playmaker Support
Re: Create object as child action??
« Reply #2 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