playMaker

Author Topic: Singleton Manager  (Read 5029 times)

ncindie

  • Playmaker Newbie
  • *
  • Posts: 4
Singleton Manager
« on: January 22, 2016, 11:01:37 AM »
Hi and good day to you,

I am currently new to playmaker and have been slowly creating a metroidvania platformer style game. I have my Player spawning where needed and also have now prevented it from duplicating on level load.

However, I have been using the singleton manager action that Jean created a long while back. This works a treat when just placed in the start function of my player FSM. But the minute I then add a singleton manager to my camera, this creates 1 camera on level load (perfect) but now creates 2 players again!

I do have don't destroy on load on both camera and the player as I want to carry these both to every scene together.

I did have the camera set as a child to the player which worked perfect for scene transitions etc. but the minute I turned the character around to face left the camera then spun around to the back of the player (not ideal).

Hope my rambling makes sense and that someone can be of assistance.

Thanks guys.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Singleton Manager
« Reply #1 on: January 26, 2016, 07:14:09 AM »
Hi,

 have you declared a distinct reference for both singleton? each singleton has to be unqiue, so you need one id for the player and one id for the camera.

 Can you reference the thread you found for thie singleton, I think I wrote several versions actually.. :)

Bye,

 Jean

ncindie

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Singleton Manager
« Reply #2 on: January 26, 2016, 05:49:25 PM »
Yes Jean,


I have set my Singleton Manager Ref as "Player" for my player and "Camera" for my camera - unique huh? :P

These are placed in the start state of a separate FSM. So outside of my player movements etc. I have a singletonDestroy FSM set up on player. This calls Singleton first followed by Don't Destroy. This is the same for my camera FSM too.

Thanks again Jean.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Singleton Manager
« Reply #3 on: February 03, 2016, 06:31:27 AM »
Hi,

 Ok, I'll try to repro this, hopefully before the end of the week. Please bump on friday if did not reply.

Bye,

 Jean

ncindie

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Singleton Manager
« Reply #4 on: February 08, 2016, 08:11:54 PM »
Hi Jean,

I allowed extra time as I know you are busy, didn't want to bother you too soon!

But now I am issuing a BUMP! :P

Thanks for looking into this for me

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Singleton Manager
« Reply #5 on: March 30, 2016, 07:07:23 AM »
Hi,

 yeah... I need the bumps :) I have put this on my short list, will run this again to double check and maybe find out the problem and repro what you are experiencing.


Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Singleton Manager
« Reply #6 on: March 31, 2016, 05:13:27 AM »
Hi,

 ok, I found the bug and fixed it, so now you can indeed have multiple references and they will all work independantly.

 I also added a new action "DeleteSingletonReference", for advanced use where you indeed delete a singleton from the hierarchy, you would not be able to have one back if you don't remove the reference internally, so use that new action when you delete a singleton.

both actions on the Ecosystem :) simply update SingletonManager to have the fix.

Thanks for your patience :)

 Bye,

 Jean

carl201010

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Singleton Manager
« Reply #7 on: May 21, 2016, 06:29:28 AM »
I just have to say; I have only been working with Unity for a few months and as a long-standing artist slowly turning dev I've found the process of learning the application to be thoroughly enjoyable. Excellent though Unity support is, I've been really surprised to see that Playmaker support is right up there with it. I've been rolling up my sleeves, gritting my teeth and getting into all that squiggly bracket stuff but every time I run into a problem I come back to the Playmaker forum and find that you guys have a solution for it that involves a couple of clicks and a check-box. So this isn't off-topic, I was looking for a Singleton manager - and guess what? I found one right here. Nice one Jean, keep up the good work - please!!!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Singleton Manager
« Reply #8 on: May 23, 2016, 02:30:15 AM »
Hi,

 Thanks for your words. There is no plan to stop anytime soon, so don't worry :)

Indeed, when I started Unity, the community was key in my decision to start using this as my main development tool, Community is the only way in development, good documentation is of course essential but a lot more expensive and tedious to take care of, and anyway it will come down to interpretation and questions, and naturally falls back into forum.


Bye,

 Jean