playMaker

Author Topic: CreateObject Advanced ( parenting and naming)  (Read 2879 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
CreateObject Advanced ( parenting and naming)
« on: October 13, 2015, 04:29:12 AM »
Hi,

 For improved productivity, I duplicated CreateObject and added the possibility to name the created Object as well as parent it ( to the owner if wanted).



 You can get it on the Ecosystem or below:

CreateObjectAdvanced
 
Bye,

 Jean

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 622
    • View Profile
    • Flashing Lights
Re: CreateObject Advanced ( parenting and naming)
« Reply #1 on: October 13, 2015, 05:36:42 AM »
Awesome improvement, thanks!

dudebxl

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Re: CreateObject Advanced ( parenting and naming)
« Reply #2 on: October 13, 2015, 05:59:09 AM »
I will be a groupie and +1 this action.

 ;D

omgitstri

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
    • My Prototypes
Re: CreateObject Advanced ( parenting and naming)
« Reply #3 on: December 12, 2017, 05:35:38 PM »
Hello,

This is a great action! I was wondering if I could make a small request if it's not too complicated.

Since we can parent the Gameobject to a parent, is it possible to set whether the Position and Rotation of the spawned object will be using the World Space or Local Space? I notice that it is only using the World Space at the moment.
Tri Nguyen
Game Designer at Nvizzio Creations

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4804
    • View Profile
    • jinxtergames
Re: CreateObject Advanced ( parenting and naming)
« Reply #4 on: December 13, 2017, 11:05:45 AM »
Hi omgitstri.
The object is set to a parent 'after' positioning and rotating, so both would give the same result.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: CreateObject Advanced ( parenting and naming)
« Reply #5 on: December 13, 2017, 11:20:57 PM »
Hi,

 no no, the request is good, indeed with UI, it changes the way the RectTransform is treated.

So basically now you have a WorldPositionStays bool, and when parenting it will either keep the new object in place or replace it relative to its parent.

Let me know if this works for you ( it's updated on the ecosystem)


 Bye,

 Jean

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4804
    • View Profile
    • jinxtergames
Re: CreateObject Advanced ( parenting and naming)
« Reply #6 on: December 14, 2017, 01:35:19 AM »
Hi.
indeed, i did not think about the UI.

omgitstri

  • Playmaker Newbie
  • *
  • Posts: 46
    • View Profile
    • My Prototypes
Re: CreateObject Advanced ( parenting and naming)
« Reply #7 on: December 14, 2017, 08:10:14 AM »
Hello Jean,

I got the update on the action and I am getting this error when I try to instantiate an object.

Quote
NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.CreateObjectAdvanced.OnEnter () (at Assets/PlayMaker Custom Actions/GameObject/CreateObjectAdvanced.cs:95)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:199)
HutongGames.PlayMaker.FsmState.OnEnter () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2670)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2628)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2556)
HutongGames.PlayMaker.Fsm.Start () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1851)
PlayMakerFSM.Start () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:501)

Sorry for causing more trouble TT.TT
Tri Nguyen
Game Designer at Nvizzio Creations

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: CreateObject Advanced ( parenting and naming)
« Reply #8 on: December 20, 2017, 01:00:38 AM »
Hi,

 Oups... please redownload from the ecosystem :) I fixed it.

 Let me know how it goes.

 Bye,

 Jean

ransomink

  • Playmaker Newbie
  • *
  • Posts: 44
    • View Profile
Re: CreateObject Advanced ( parenting and naming)
« Reply #9 on: December 21, 2017, 07:00:30 PM »
Was creating this type of action myself but I'd rather employ yours. To top it off, I was going to allow the user to set the game object active or not. A great use for pooling objects and cutting out naming, parenting, and setting to in/active. Think you can add a boolean to SetActive or not?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: CreateObject Advanced ( parenting and naming)
« Reply #10 on: December 21, 2017, 11:59:08 PM »
Hi,

 yes good idea, it's in, please update from the Ecosystem.

 Bye,

 Jean