playMaker

Author Topic: Creating new Object without Children  (Read 1722 times)

Athin

  • Full Member
  • ***
  • Posts: 163
Creating new Object without Children
« on: April 29, 2018, 02:20:55 AM »
Hey all,

I got a dumb question I'm hoping someone can answer for me.  I know its probably a simple problem but I just can't see what I'm doing wrong. 

Basically over time the hut spawns enemies and parents those enemies to the hut.  Once the hut remains for X amount of time, it will produce another hut randomly around it.  Problem is that when I use a create action for the hut prefab, it clones all the enemies the previous hut spawned.  I'm not sure what is causing this as I'm only using the prefab to create the object that has no children.  Has anyone got any ideas what is doing this?

Edit: Looking into this a bit more, it seems that the hut is spawning the prefab in the editor but as soon as I launch the game it switching to the hut in the scene?  I'm just getting more and more confused by this now but any help would be very welcome.

Edit 2: It seems like there is an issue or bug with prefabs trying to create themselves maybe?  I made 2 different named Prefabs that spawn each other but have the exact same function and now seems to be working perfectly.  Looks like this is just a little workaround the issue I found. 

Thanks
« Last Edit: April 29, 2018, 03:11:19 AM by Athin »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Creating new Object without Children
« Reply #1 on: May 09, 2018, 05:56:09 PM »
Are you creatinf the hut from prefab? That shouldn't happen if you are. If you are dropping an object from the scene in that little create object box, there's the source of your problem.
Available for Playmaker work

Athin

  • Full Member
  • ***
  • Posts: 163
Re: Creating new Object without Children
« Reply #2 on: May 10, 2018, 08:02:14 AM »
I was creating it from the Prefab but for some reason it appears to then replace it with the object in the scene once you play test it oddly.  I ended up doing a work around it but I'm curious if others now have seen this happen when a prefab object tries to create itself.  Waiting for the 1.9 update to be release and may test again to see if the issue still appears.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Creating new Object without Children
« Reply #3 on: May 10, 2018, 05:00:48 PM »
Probably something with prefab making a copy of itself,  as you noted. Maybe it would not be bad to try it out in an empty project with few objects.
Available for Playmaker work