|
Post by christougher on Oct 7, 2015 11:52:30 GMT
I'm running into a problem regarding my death animation after respawning. It seems the animator recalls the pose it was in when it was despawned (in my case crumpled on the floor). When it is respawned and it is not receiving any kind of input it reverts to the pose it was left in when it died. My animations involve a move, pause and shoot and the odd anim state is only viewable when it's pausing. In another type of AI I had the same issue but it was easily remedied by having an idle pose (this seemed to override it) in my 2d blend tree. However with my current enemy I have a Direct blend tree and so I can't really put a idle pose in the middle... any thoughts of how to clear the animator's memory at respawning?
I have a bit of a workaround by disabling the mesh renderer a short while before Death Delay timer runs out and I set the animator bool death to false hoping to transition back to a fully standing position, but is hit or miss due to mecanim timing/transitions. I'd prefer the animator start fresh when respawning.
|
|
|
Post by DarkTonic Dev on Oct 7, 2015 15:19:43 GMT
That's normal. Everything will be kept as when it despawned. You can add another script to that game object and make sure to set a Mechanim variable that will get your character back to the correct state in OnDespawned method, which gets called automatically before something gets despawned.
|
|