Page 1 of 1

How to make actor disappear when lifes = 0

PostPosted: Fri May 04, 2018 11:34 pm
by Ehman
How can I make an actor disappear when life =0
Please help me! :oops:

Re: How to make actor disappear when lifes = 0

PostPosted: Sat May 05, 2018 7:37 pm
by MrJolteon
In a draw actor script:
Code: Select all
if(life==0)
{
    DestroyActor("Event Actor");
}

Re: How to make actor disappear when lifes = 0

PostPosted: Sun May 06, 2018 10:32 am
by Ehman
Thanks mr. Jolt. :|

Re: How to make actor disappear when lifes = 0

PostPosted: Tue May 08, 2018 2:59 pm
by tdmxross
So we need to use == instead just using = ?
for example, if we want to trigger an event when the value of 'Angle' reaches 90, then we should do this-

if (angle==90)
{
DestroyActor("Event Actor");
}

is this how it works?
i didn't knew about this

Re: How to make actor disappear when lifes = 0

PostPosted: Tue May 08, 2018 3:09 pm
by juansimat
= is an assignment operator (assigns the value of the right side to the left side).
== is a comparison operator (checks if both sides are the same).

You can read more about operators here.

Re: How to make actor disappear when lifes = 0

PostPosted: Wed May 09, 2018 4:33 am
by tdmxross
juansimat wrote:= is an assignment operator (assigns the value of the right side to the left side).
== is a comparison operator (checks if both sides are the same).

You can read more about operators here.

Thank you so much!! :D
1+ score for helping me out :wink: