playMaker

Author Topic: Create Object as Child "Instantly"  (Read 1139 times)

Handrews

  • Playmaker Newbie
  • *
  • Posts: 36
  • 3D Artist & Game Developer
    • Thetra Games Artstation
Create Object as Child "Instantly"
« on: December 03, 2020, 10:40:20 AM »
I know there is an action called "Set Parent", but it takes a moment to attach the object as child after create it, and i need that the objects gets created instantly as a child...basically the object i create from a prefab have an fsm that disables an fsm from the parent object, but in the moment of the creation the object dosent ve any parent, so the fsm don`t work. I need that the objects disables instantlly the fsm of the parent object.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Create Object as Child "Instantly"
« Reply #1 on: December 03, 2020, 11:03:29 AM »
Hi.
Not Sure what you are trying to do, but even in c# you still need to create and then set parent.

What you can try is, on the prefab have a event to start the fsm.

like this :

Create (store the created object)
Set Parent
Send Event By Name (start Fsm)

on the prefab set the 'start' state empty then set a Global Transition to where you want to start (start Fsm)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Create Object as Child "Instantly"
« Reply #2 on: December 03, 2020, 12:09:31 PM »
As far as i know, instantiate has Parent as one of the parameters, but as Djaydino said, it creates and object and then it assigns him a parent. Give you FSM's time to breath, for exactly that reason most of my stuff have "Activation Wait" of usually at least 0.1.
Available for Playmaker work

Prestonh

  • Playmaker Newbie
  • *
  • Posts: 44
Re: Create Object as Child "Instantly"
« Reply #3 on: December 13, 2020, 03:16:25 PM »
Create object 2 on eco