#Coroutine Burn Effect
1 messages · Page 1 of 1 (latest)
@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.
i prolly can for now
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.
Do you clear the effect variable ?
my guess is that effect needs to be cleared
Caching the coroutine and calling stop on that is a sure way too
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.
reset effect in onenable
reset effect in onenable
how would one do this? i am confused.
you need
void OnEnable()
{
burn_Active = false
}
i have this
and stop coroutine?
yes
post code
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
you should post the code, in case you were only slightly off on the logic
its a total mess atm sorry
and the courotine in void burn isnt supposed to look like that, its workin fine.
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
yeah im trying to save space 😄
I always see these wrong 😂
same here
so this script is attached to an enemy character
yes
it takes damage from Particles, and they cause a burn
xD
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);
}
well at least i wont snitch 😩
how about, is it possible to change properties in OnDisable() ?
I've never tried that way
yeah, stop the Coroutine in OnDisable
i do notice, that it doesn't happen if the courotine manages to finish
hmm
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
wait - make him travel Further before he respawns
particle system is play on awake
hm
Awake is called when the script instance is being loaded.
before OnEnable() or Start()
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.
and the character is still burning on respawn?
yes
get to that point, click Pause in the Editor
right-click the Inspector word and choose Debug
It should give you a lot of information about the object, while paused in Play mode
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
I want you to screenshot the Debug info while the enemy is burning after respawn
you need to select the Game Object to inspect, for the Debug to show any info
yeah sorry realized.
reading alot about Ienumerators, nad they cant apparently be stopped like regular couroutines, so working on trying some of that now.
alright
that didnt work either.
ill post code and come back later i am getting burned out from this XD
alright man :)