Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Jones on January 06, 2020, 01:11:27 PM

Title: How do I turn off clone creation?[SOLVED]
Post by: Jones on January 06, 2020, 01:11:27 PM
How do I turn off clone creation?

Sorry about the stupid question, I'm new to the playmaker.  I have a group of objects in an array and one object that randomly selects an object from an array and appears on its surface, but the object continues to clone itself until it is created on each object of the array, I need only one random creating.

(https://i.ibb.co/f9hyp97/2020-01-06-200400.jpg) (https://ibb.co/sC0NwCr)
Title: Re: How do I turn off clone creation?
Post by: Athin on January 06, 2020, 09:56:37 PM
Heya,

Sounds like you have it looping through the array but I can't see exactly what is going on in the pictures.  Can you take a snap shot of each state with the actions as well as the array the objects are stored in so I can help with the exact problem?
Title: Re: How do I turn off clone creation?
Post by: jeanfabre on January 07, 2020, 04:15:53 AM
Hi,

 also, can you take pixel perfect screenshots, here I can't really see anything.

Bye,

 Jean
Title: Re: How do I turn off clone creation?
Post by: Jones on January 08, 2020, 08:57:05 AM
Hi,

 also, can you take pixel perfect screenshots, here I can't really see anything.

Bye,

 Jean

Here are screenshots of the status of the state. When I add the required objects to an array, and select the array as the source for another object to appear, I start to have clones of the object in the scene ... but I need to have one object.
Title: Re: How do I turn off clone creation?
Post by: Farwest on January 08, 2020, 09:12:23 AM
I suggest separating Array Get Random and Create Object actions.

State2: Array Get Random
State3 (transition from State2): Create Object. This way it should pick only one variable randomly from your Array, then you create it.

Otherwise, it seems all the array is looping when both actions are within same state.
Title: Re: How do I turn off clone creation?
Post by: Jones on January 08, 2020, 09:50:05 AM
I suggest separating Array Get Random and Create Object actions.

State2: Array Get Random
State3 (transition from State2): Create Object. This way it should pick only one variable randomly from your Array, then you create it.

Otherwise, it seems all the array is looping when both actions are within same state.
I did, but the object keeps cloning itself... Maybe I'm setting the properties of the state wrong?
Title: Re: How do I turn off clone creation?
Post by: Athin on January 08, 2020, 11:29:05 PM
Heya,

I'm still unsure of your issue with the screen shots but I can see you have 5 errors happening.  Unity does some very odd things once you get a red error.  As soon as I get one red error I stop and try to fix it.  Anything that breaks after the red error may not be real. (A bug of a bug type thing)

From what I can see though I feel your logic is off as well perhaps?  Never showed us what happens in State 1 but State 2 has a finish event that links to nothing (1 red error).  Also you are creating the object first and then you're grabbing the random object to spawn on.  Actions go in order from top to bottom so you'll want to first find the spot you want the object to spawn and then spawn the object to that location.

Try cleaning up the States with that and see if you can make it work otherwise come on back with more snapshots of each state so I can help more.

Title: Re: How do I turn off clone creation?
Post by: Jones on January 09, 2020, 06:53:08 AM
Heya,

I'm still unsure of your issue with the screen shots but I can see you have 5 errors happening.  Unity does some very odd things once you get a red error.  As soon as I get one red error I stop and try to fix it.  Anything that breaks after the red error may not be real. (A bug of a bug type thing)

From what I can see though I feel your logic is off as well perhaps?  Never showed us what happens in State 1 but State 2 has a finish event that links to nothing (1 red error).  Also you are creating the object first and then you're grabbing the random object to spawn on.  Actions go in order from top to bottom so you'll want to first find the spot you want the object to spawn and then spawn the object to that location.

Try cleaning up the States with that and see if you can make it work otherwise come on back with more snapshots of each state so I can help more.
Thank you, I've already figured it out, I've solved it with a get random child.