#Coroutine Burn Effect

1 messages · Page 1 of 1 (latest)

normal kiln
#

@quick ether
I'm not sure if I can help, but in case no one can immediately, this thread will be visible for 24hrs.
During the day, more people will come online. I am certain someone will be able to help you.

daring niche
#

i prolly can for now

normal kiln
#

Me, earlier:

So far I've gathered that this burn effect can be triggered by OnParticleCollision
I believe maybe you need to set burn_Active = false as part of the character's death event,
because the character might die before the Coroutine reaches the part where it sets false itself
Otherwise, try placing a Debug.Log at the resurrection of the character, and see if the bool is true or false.

unborn river
#

Do you clear the effect variable ?

daring niche
#

my guess is that effect needs to be cleared

unborn river
#

Caching the coroutine and calling stop on that is a sure way too

quick ether
#

i am not sure how to do this, i even inserted Yield break inside the courotine if the target health gets below 0. i am not sure this works eitherway since it might become 0 from alot of sources.

daring niche
#

reset effect in onenable

quick ether
#

i had a stopcorutine now in enable, is that the wrong way?

#

cause that did not work

daring niche
#

reset effect in onenable

quick ether
#

how would one do this? i am confused.

normal kiln
#

you need

void OnEnable()
{
    burn_Active = false
}
quick ether
#

i have this

normal kiln
#

and stop coroutine?

quick ether
#

yes

normal kiln
#

post code

quick ether
#

i don't have that now anymore, since it didnt work. now i tried sometthing else. but i am trying to use a Ienumerator reference instead, since that might be the issue. ill try that first

normal kiln
#

you should post the code, in case you were only slightly off on the logic

quick ether
#

its a total mess atm sorry

#

and the courotine in void burn isnt supposed to look like that, its workin fine.

normal kiln
#

hmm

#

are you aware the an IF without curly-brackets only has one line of return?

#

at least, I'm fairly certain that is the case

#

ah wait

#

I'm looking at it wrong

#

ignore that

quick ether
#

yeah im trying to save space 😄

normal kiln
#

I always see these wrong 😂

quick ether
#

same here

normal kiln
#

so this script is attached to an enemy character

quick ether
#

yes

normal kiln
#

it takes damage from Particles, and they cause a burn

quick ether
#

yes

#

yes

#

xD

normal kiln
#

xD

daring niche
#

youll be safe from mods here rov

#

hopefully

normal kiln
#

will I really? :3

#
void OnEnable()
    {
        burn_particle.Stop();// make into own function for all these types
        CurrentHitpoints = maxHitpoints;// + bank.difficultyRamp;
        burn_Active = false;
        StopAllCoroutines();
        Debug.Log(" burnA: " + burn_Active);

    }
daring niche
#

well at least i wont snitch 😩

normal kiln
#

how about, is it possible to change properties in OnDisable() ?

#

I've never tried that way

quick ether
#

yeah it should be.

#

heres a visual

normal kiln
#

yeah, stop the Coroutine in OnDisable

quick ether
#

i do notice, that it doesn't happen if the courotine manages to finish

normal kiln
#

hmm

daring niche
#

check if your OnParticleCollision method is being called after it wakes up

#

throw a debug in there perhaps to check to see if its getting called

normal kiln
#

wait - make him travel Further before he respawns

quick ether
#

particle system is play on awake

normal kiln
#

hm

quick ether
#

oh wait i missunderstod

#

i also had my concerns that this might have been the issue.

normal kiln
#

Awake is called when the script instance is being loaded.

#

before OnEnable() or Start()

quick ether
#

So, ondisable, stopping courotine does nothing. The bool is correct on respawning. The range to travel does nothing. oncollison particle does not run when enabled.

normal kiln
#

and the character is still burning on respawn?

quick ether
#

yes

normal kiln
#

get to that point, click Pause in the Editor
right-click the Inspector word and choose Debug

quick ether
#

right-click where sorry

#

ok i am in debug now, says nothing @normal kiln

normal kiln
#

It should give you a lot of information about the object, while paused in Play mode

quick ether
#

this is what i have, nothing seem to have worked, my guess is almost 90% certain this is about the courotine not being stopped when stopallcourotines

normal kiln
#

I want you to screenshot the Debug info while the enemy is burning after respawn

normal kiln
quick ether
#

yeah sorry realized.

#

reading alot about Ienumerators, nad they cant apparently be stopped like regular couroutines, so working on trying some of that now.

normal kiln
#

alright

quick ether
#

that didnt work either.

#

ill post code and come back later i am getting burned out from this XD

normal kiln
#

alright man :)