/* * Transition from ragdolled to animated through the Blend state */ void StartGetUp() { //reset bone fall decay modifiers ResetBoneDecays(); //set fall speed to use default SetFallSpeed(-1); //disable physics affecting ragdoll ragdoll.UseGravity(false); ragdoll.IgnoreSelfCollisions(true); //save the ragdoll positions ragdoll.SaveSnapshot(); Vector3 ragdollHipsFwd = ragdoll.RootBone().transform.rotation *rootboneToForward *Vector3.forward; // Check if ragdoll is lying on its back or front bool onBack = Vector3.Dot(ragdollHipsFwd, Vector3.down) < 0f; // play get up animation animator.SetTrigger(onBack ? "BackTrigger" : "FrontTrigger"); ChangeRagdollState(RagdollControllerState.TeleportMasterToRagdoll); }
/* * Transition from ragdolled to animated through the Blend state */ void StartGetUp() { //reset bone fall decay modifiers ResetBoneDecays(); //set fall speed to use default SetFallSpeed(-1); //disable physics affecting ragdoll ragdoll.UseGravity(false); ragdoll.IgnoreSelfCollisions(true); //save the ragdoll positions ragdoll.SaveSnapshot(); Vector3 ragdollHipsFwd = ragdoll.RootBone().transform.rotation *rootboneToForward *Vector3.forward; // Check if ragdoll is lying on its back or front bool onBack = Vector3.Dot(ragdollHipsFwd, Vector3.down) < 0f; eventPlayer["OnFront"].SetValue(!onBack); AssetObjectsPacks.Playlist.InitializePerformance("getup", getUpEvent, eventPlayer, false, 1, new AssetObjectsPacks.MiniTransform(Vector3.zero, Quaternion.identity), true, onEndGetUp); // play get up animation //animator.SetTrigger(onBack ? "BackTrigger" : "FrontTrigger"); ChangeRagdollState(RagdollControllerState.TeleportMasterToRagdoll); }
/* * Transition from ragdolled to animated through the Blend state */ void StartGetUp() { //reset bone fall decay modifiers ResetBoneDecays(); //disable physics affecting ragdoll ragdoll.UseGravity(false); ragdoll.IgnoreSelfCollisions(true); //save the ragdoll positions ragdoll.SaveSnapshot(); Vector3 ragdollHipsFwd = ragdoll.RootBone().transform.rotation *rootboneToForward *Vector3.forward; // Check if ragdoll is lying on its back or front bool onBack = Vector3.Dot(ragdollHipsFwd, Vector3.down) < 0f; PlayGetUpAnimation(onBack); ChangeRagdollState(RagdollControllerState.TeleportMasterToRagdoll); }
/* * Transition from ragdolled to animated through the Blend state */ public void StartGetUp() { //reset bone fall decay modifiers ResetBoneDecays(); //disable physics affecting ragdoll ragdoll.UseGravity(false); ragdoll.IgnoreSelfCollisions(true); //save the ragdoll positions //ragdoll.SaveSnapshot(); //Vector3 ragdollHipsFwd = ragdoll.RootBone().transform.rotation * rootboneToForward * Vector3.forward; // Check if ragdoll is lying on its back or front //bool onBack = Vector3.Dot(ragdollHipsFwd, Vector3.down) < 0f; //PlayGetUpAnimation(onBack); // // play get up animation //animator.SetTrigger(onBack ? "BackTrigger" : "FrontTrigger"); //ChangeRagdollState(RagdollControllerState.BlendToAnimated); //Aqui esta mi version /*animator.cullingMode = originalAnimatorCullingMode; * EnableRenderers(true, false); * ChangeRagdollState(RagdollControllerState.Animated);*///aca termina ragdoll.SaveSnapshot(); Vector3 ragdollHipsFwd = ragdoll.RootBone().transform.rotation *rootboneToForward *Vector3.forward; // Check if ragdoll is lying on its back or front bool onBack = Vector3.Dot(ragdollHipsFwd, Vector3.down) < 0f; PlayGetUpAnimation(onBack); // // play get up animation // animator.SetTrigger(onBack ? "BackTrigger" : "FrontTrigger"); ChangeRagdollState(RagdollControllerState.BlendToAnimated); }