From 21fe28716bce0821a4a450fccdb53a00e1f2085c Mon Sep 17 00:00:00 2001 From: Joshua Reason Date: Sat, 10 Oct 2015 21:16:36 +1100 Subject: [PATCH] added blend tree for strafing left and right --- .../Character/Character_Animation.controller | Bin 16532 -> 17556 bytes .../Assets/Scripts/thirdPersonController.cs | 3 +++ 2 files changed, 3 insertions(+) diff --git a/unity_Project/Assets/Character/Character_Animation.controller b/unity_Project/Assets/Character/Character_Animation.controller index 72f08475185291d40cbf72cb6d6bb2971c21e589..0db0ede8e62ab7e382685339dffcd97ce262040e 100644 GIT binary patch delta 1543 zcmb`HQAkr!7{|Xmr`}DSOXsX>!Hu@LdA06?pl%H#d>EBt2_h(A;ljjZBuRwi1QD|Y z^BZA4RD=(EtwD%^`Vtt0h!ljxSV1r(($^xe@7$xd?hPvF!ae7n@Ap6d`+eu!dt$>v z?3Q2$@I3=)hyg$$J+D5oJ6(!OBY@QUxYn~~P5@}9z8$u=**H1trwGOItgCpaVU3Tj zn*h=jUD0l?932X1%FZk!TYAM=$ZTYzYn-XsMwV}z%wccePwgcD?01!zqB%J3lKg23 z^$}_$%SJO#;jxFy+j5QUqr%y8E+$=)saC{qdV?{Ytw9n|$vA~saVk6|zM4Q&MvuV>WIa7=9Cb`TN;S9N`#Q+hV^5V#p zmdhhzlR7p(%9-lGFXR$;pw&yclmLwBlmqizxkOB#i*1#&kQ2{)sUj!dAeYWkfI*#0 za`V2HON!VmefKR?QOiz6XO7HhZ0rE8kc%kchIb7kJ`v9ZMSSgZpsI+N_Q@<}p^4CP zxhpK-1z#DSsE{>!uuc>#TI5c}G=2({k~SL~lv(sDl`8#W!0y%!wnprVF7jS$>sd>` z6P)Y~_jOS}6?9;a&x%(SXEU4E{BxeBr4YLe^H^{B(=Dnar*m;{s e)wK)4A|4M^@)(_^iAW&E73{Ru=2Ql|vwi?8AxAg> delta 956 zcmZvbO=uHA6vy9g(llR9lO_#eKv44iflWL}Tw_v2r1%k(1rb{$NFv&U1}sHHq(YIZ z2+~Iq^8j}?|D%10axJOHte=UB9_Rf`@{9n?YbfmMARlSk z46a44ZH?dtQI-tYCQ6U$(>fpB&H8-9Of7DTb<5XmqI?56Mjz9fQ zM*{Mtd_i6)6nDzSLLm#E20DI(@ldSMzrr-QZBCt-yC1vo^Jx0c>72pLReVt*ap QdMUH;&l0T159W2h0T1cm-T(jq diff --git a/unity_Project/Assets/Scripts/thirdPersonController.cs b/unity_Project/Assets/Scripts/thirdPersonController.cs index 454884c..91da8b3 100644 --- a/unity_Project/Assets/Scripts/thirdPersonController.cs +++ b/unity_Project/Assets/Scripts/thirdPersonController.cs @@ -106,6 +106,9 @@ public class thirdPersonController : MonoBehaviour { animator.SetBool ("Grounded", grounded); animator.SetFloat("Run speed",new Vector3 (rigidbody.velocity.x, 0.0f,rigidbody.velocity.z ).magnitude * Mathf.Sign(movementY)); + Vector3 side = transform.InverseTransformDirection (rigidbody.velocity).normalized; + animator.SetFloat ("Side",side.x); + rigidbody.AddForce (new Vector3 (0.0f, -9.81f,0.0f)); curCollider = null;