Enemies don't look dead after reloading scene

After Im going through a portal the enemies I’ve already killed still in the idle animation state
they are dead, even their collider is gone, but they’re animation is idle and not “die”
when I press the keycode for Load() (which happens already in the portal script)
they do start the animation for dying, even after I’ve gone through the portal before pressing for load…
please help, I’ve sorted many bugs on the SceneManagmet but got really stuck on this one
thanks in advanced,
Shaked

on the second scene that problem doesn’t happen…

Any message in the console log?


nothing relevant…

Did you try deleting your save file and playing again?

yes, sometimes the fader doesn’t fade in, so I have to delete it manually… another bug ill have to resolve:)
but I’ve just found that it happens only to this enemy, don’t actually see why cause he has the same components as other enemies, only a different weapon…
but at least that really narrowed my problem! thanks!

That’s really weird! Did you compare your code with the github commit of the lesson you’re taking?

yes, even copy paste for the check!
but I did added stuff and changed some so I guess that’s why…
still weird its only for the guy with the bow:/
(haven’t fixed it yet, made other stuff, like weapons;) )

It’s only happening with the archer, he “looks” idle, but is in fact dead?

Check our animator Override for the bow to make sure that the death animation is not overriden with the idle animation.

I have an enemy using the “Fireball” animator override that has the same problem…
I’ve put an unarmed enemy next to him,
when coming back to the scene, the unarmed was dead, and the fireball one looks Idle (he’s actually dead)

Can you post a screenshot of the AnimatorOverride for this character? (Actually a screenshot of both of their inspectors)

I agree with Brian. It seems that your animator override is not receiving the parameter that changes the animation state. If your enemy’s health is 0, the code checks the value and triggers the death animation.

Actually, I suspect that the death animation is being overridden with the idle animation…

that’s sounds about right
I’ve tried putting the armed-death1 on the override controller though it didn’t work:/
how can you fix it?

You don’t have a death animation in your controller, only the attack animation. Just add it to “Armed-Death1” in both controllers and it will probably works. Also double check if you have the death trigger in the animator.

This is only the override control, i thought like you so I tried putting the death-armed1 on the bow though it didn’t change anything

No, that’s not the issue, it would appear… if you don’t replace a field, it falls back to what’s in the controller. So we need to figure out what’s causing these guys not to get the signal that they’re dead.

Upload your project to https://gdev.tv/projectupload
Be sure to Zip it up and remove the Library folder from the zip to save space.

I’ll have a look at it and see if we can get this sorted.

submitted, thanks in advanced!
btw, I’m using visual studio and not code. does that make any difference through the course?

Not at all. I use Visual Studio Community 2019.

I’m working on your project, but what I’m finding is even wierder than you describe…
I’ve got enemies who were dead coming back to life
I’ve got enemies I’ve not even seen yet dying on a restore…

Peppering the project with Debugs to get an idea what’s going on

Privacy & Terms