playMaker

Author Topic: Setting GameObject Parent to Instantiated Prefab[SOLVED]  (Read 3338 times)

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Setting GameObject Parent to Instantiated Prefab[SOLVED]
« on: June 18, 2013, 08:53:06 AM »
I'm still very new to PlayMaker but I'm really liking it.  I just have to get my head around a few differences between code and this new FSM style machines.

I have the MainCamera as a child inside an empty gameObject.

No players have been instantiated yet.

Then, when you begin the game it instantiates a player prefab.

I then want the empty gameObject with the camera, to be set parented into the player prefab.

Can someone help me with how this can and should be done?
« Last Edit: June 19, 2013, 01:30:23 AM by jeanfabre »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Setting GameObject Parent to Instantiated Prefab
« Reply #1 on: June 18, 2013, 08:56:27 AM »
When you do the Create Object action to spawn the player, store the created object in a variable, then use Set Parent and choose the main camera, and choose that variable.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: Setting GameObject Parent to Instantiated Prefab
« Reply #2 on: June 18, 2013, 11:12:17 AM »
That's just what I was looking for.

Thank you so much!