Difference between revisions of "Make character disappear"
no edit summary
imported>Hawkes |
imported>Rbt hlpr mnky |
||
Line 1: | Line 1: | ||
I'm trying to have a NPC dissapear when he dies with the SetActorAlpha fonction but it does not seem to work is there or another way? or can someone tell me what is wrong with the script? | I'm trying to have a NPC dissapear when he dies with the SetActorAlpha fonction but it does not seem to work is there or another way? or can someone tell me what is wrong with the script? | ||
Several things are "wrong" | |||
# [[OnDeath]] runs only once. | |||
# timer is not set to 0 (or declared) | |||
# [[GetSecondsPassed]] is a float and contains the seconds passed since last frame typically something like '.03' on my box. | |||
# not wrong, but should use if/elseif/elseif/... instead of many if commands | |||
Something with a ref (set to dead actor in onDead) and GameMode that has the logic below but rewritten to use float (e.g. <= 1 instead of == 1) and to only run once. | |||
<pre> | <pre> |