playMaker

Author Topic: Just started... Why is the FSM disabled with created objects? [SOLVED]  (Read 3280 times)

Athanateus

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Hi there

I'm trying to learn how to use Playmaker/Unity and in particular I'm trying to create an endless pile of cubes which break upon mouse click on the cube and at the same time spawn a new cube above the camera view.

I think I have most of this down using a prefab object which spawns a clone of itself; but the FSM for that clone is disabled. I have no idea why and can't seem to find any options to change this?

Can anyone help?

I suspect its pretty obvious - but I just cant see.
« Last Edit: July 01, 2014, 11:16:42 AM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Just started... Why is the FSM disabled with created objects?
« Reply #1 on: June 30, 2014, 10:09:48 AM »
If the FSM is enabled on the prefab it should be enabled on the created instance...

Quote
I think I have most of this down using a prefab object which spawns a clone of itself; but the FSM for that clone is disabled. I have no idea why and can't seem to find any options to change this?

Are you sure you're looking at the clone and not the Prefab? A prefab will say DISABLED at runtime because it's not a scene object and isn't running...

Can you post a screenshot or video?

Athanateus

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Just started... Why is the FSM disabled with created objects?
« Reply #2 on: June 30, 2014, 12:14:37 PM »
no probs (although its been so long since I used a forum like this in anger I may be missing some tricks) 

I posted up some images on my blog as well as a longer description here:

http://www.gamesasaservice.net/blog/time-learn-use-unity/

I've posted URLS to the images direct here too. This first one is what I get when I select to prefab.



and then when I play in the game screen I get this:



Does that help? Despite 16 years in the industry I've always be the strategy guy rather than the game maker so sorry if I come across as dense.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Just started... Why is the FSM disabled with created objects?
« Reply #3 on: June 30, 2014, 12:49:48 PM »
Create Object should reference the Prefab - it looks like it's referencing an instance in the scene (which is probably getting disabled and then copied).

Athanateus

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Just started... Why is the FSM disabled with created objects?
« Reply #4 on: July 01, 2014, 12:38:57 AM »
Ah! ok will try that now

Athanateus

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Just started... Why is the FSM disabled with created objects?
« Reply #5 on: July 01, 2014, 05:58:55 AM »
As far as I can tell the 'Create Object' does reference the prefab... and I can't see anything which would explain why its properties wouldn't replicate in the clone

Could you tell me what I should be looking for?

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Just started... Why is the FSM disabled with created objects?
« Reply #6 on: July 01, 2014, 06:15:17 AM »
In your Create Object action, you aren't referencing a prefab - which is why it says "... (clone)" in that action.  You should instead drag the prefab you want to create the object from onto your action. (e.g. from the Project window - *not* from the Hierachy window).

Also, it's probably not best practice to have those actions on one state if it's not an Action Sequence - it looks like you're simulataneously destroying your object, and trying to enable it, (and trying to spawn a new object).  I'm not sure what you're trying to achieve, but you should probably set that state to Action Sequence and order your 3 actions in the order you'd logically want it to process.

Athanateus

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Thanks Jess84... The 'enable' was a niave attempt to fix the problem...

Restarting the process and actually getting rid of the prefab solved the problem... trying to do too many things in one step was the issue.

Thanks

buggie

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Just started... Why is the FSM disabled with created objects? [SOLVED]
« Reply #8 on: October 21, 2018, 02:34:26 AM »
I ran into the same issue, the only thing was that my instances where referencing a prefab, but for whatever reason it would spawn the prefab as all scripts disabled.{paymaker, c#, and PlyBlox} I solved this by duplicating the prefab and having the first prefab reference the second one, and the second one reference the first. This solved it. They now spawn correctly.