|
Post by Chronicman on Nov 29, 2016 2:33:59 GMT
So I'm trying to revive the player for my add-on so the user can keep all the quest data and such on death. The only problem I'm having is on the second death the animation is not being preformed I think.... He just stands their until the timer hits the preferred time and will get moved back to the spawn point and restart. This is my code for reviving am I missing something ?
public IEnumerator Revive() { yield return new WaitForSeconds(respawnTimer); if (spawnPoint != null) { oldPlayer.GetComponent<vThirdPersonController>().isDead = false; oldPlayer.GetComponent<Animator>().SetBool("isDead", false); oldPlayer.transform.position = spawnPoint.transform.position; oldPlayer.GetComponent<vThirdPersonController>().Init(); Debug.Log("Revived"); } }
Thanks
|
|
|
Post by Invector on Nov 29, 2016 14:43:27 GMT
I think you need to create an exit in the death animation state
|
|
|
Post by Chronicman on Nov 29, 2016 15:47:37 GMT
I have made an exit in the death, hes standing up again after he dies hes just not entering the death state again on the second death. Ill look into this more see if I can find out some more deets. I just thought maybe I was missing a bool somewhere. It just seems to be isDead bool on anim is not being ticked true again. My guess some pesky bool is keeping it from being triggered again.
this void is only being called once that is my problem. Know where this might be called from ? thanks public void DeathBehaviour() { // lock the player input lockMovement = true; // change the culling mode to render the animation until finish animator.cullingMode = AnimatorCullingMode.AlwaysAnimate; // trigger die animation if (deathBy == DeathBy.Animation || deathBy == DeathBy.AnimationWithRagdoll) animator.SetBool("isDead", true); Debug.Log("Fired"); }
|
|
|
Post by Chronicman on Nov 29, 2016 19:34:11 GMT
HA I found the pesky bool "triggerDieBehaviour" located in vThridPersonAnimator. Thanks now its working correctly.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 4, 2016 12:59:28 GMT
That's amazing Chronicman that you want your character to die, then come back, that's awesome! What addon is it for?
|
|
|
Post by Chronicman on Dec 4, 2016 15:45:31 GMT
This is built into the RPG pack mate, The AI do the same thing. I was gonna make a spawning system for it but I think this will be better, less garbage data.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 4, 2016 17:31:57 GMT
Nice!
|
|