Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: VascBogdan on February 07, 2015, 09:49:50 AM

Title: [SOLVED]Check if exist
Post by: VascBogdan on February 07, 2015, 09:49:50 AM
Is there a way/action to find if an object exists in the scene ? For example, when a gameobject (usually enemy) dies (destroy self) I want to start a new state. (there are different FSMs)
The gameobj. is stored as a GameObject variable but how can I do this ?
Title: Re: Check if exist
Post by: billsclass on February 07, 2015, 11:07:13 AM
You could se Find Game Object and test if Game Object is Null.

Alternatively, you could create an INT Var and add each time you create an enemy and subtract from it each to you destroy an enemy. Then you can check the INT var total to see if there are active enemies.

I think you need include a little more info about what you are trying to accomplish.
Title: Re: Check if exist
Post by: VascBogdan on February 07, 2015, 12:38:28 PM
But how can I exactly test if the GameObject is null ? I believe this is the solution I want, but how ?
Title: Re: Check if exist
Post by: billsclass on February 07, 2015, 12:43:53 PM
Search for "Game Object is Null" in the logic category of Actions.
You can fire an event if null (false) or is not null (true).
Title: Re: Check if exist
Post by: VascBogdan on February 07, 2015, 12:58:51 PM
Yes, that's it. I searched for "GameObject" instead of "Game Object" and I didn't even think it can be in Logic, instead of GameObject or something. I am now trying it and edit if something is wrong. Thank you!
edit: Worked extremely fine. Thank's again!