Character "moving back"
Hello all
Got a perplexing problem, my Character has a strange bounce back effect when I apply gravity to it. When I move the character forward and release the W key he moves slightly back.
below is my script, the character has a RigidBody of 5 mass and no drag, and a capsule box collider. To me it almost seems like the collider is what is pushing back but I am new to this. Also the palne he is walking on is flast at 0,0,0 as that is the first thing I checked to see if gravity was having an impact. Would appreciate any help. using UnityEngine; using System.Collections; public class CharacterControl : MonoBehaviour { public float inputDelay = 0.1f; public float forwardVel =12; public float rotateVel = 100; Animator anim; Quaternion targetRotation; Rigidbody rBody; public float forwardInput, turnInput; public Quaternion TargetRotation { %|-1187242198_1|% } void Start() { %|2064581509_2|% %|470187183_3|% %|874613873_4|% %|621814379_5|% %|1820098339_6|% %|-1141860762_7|% %|-1146109283_8|% %|-1217053831_9|% %|-74807357_10|% %|831445344_11|% } void GetInput(){ %|477738200_12|% turnInput = Input.GetAxis("Horizontal"); } void Update(){ %|-542058015_14|% %|-1290867806_15|% if(Input.GetButtonDown("Jump")) %|-1995586450_17|% %|1984463460_18|% %|188753391_19|% %|-811487212_20|% %|-773816785_21|% %|-1283763454_22|% %|1447688794_23|% %|934421656_24|% %|238883736_25|% } if (Input.GetMouseButtonDown(0)) { %|16728698_28|% %|1682797376_29|% } void FixedUpdate(){ %|1500567940_30|% } void Run(){ if(Mathf.Abs(forwardInput)> inputDelay){ %|-438053563_32|% %|365062585_33|% else{ Vector3 v = rBody.velocity; %|1814077946_35|% %|-2095417306_36|% %|-158286331_37|% } void Turn(){ if (Mathf.Abs(turnInput) > inputDelay) { %|-708606986_40|% %|1291788617_41|% %|886193558_42|% %|-1724401550_43|% } }
Your answer
Follow this Question
Related Questions
Can anyone help me with a simple JS wait problem 0 Answers
camera moving in mouse direction 0 Answers
3D space movement: character stuck at edge in free space 0 Answers
Moving RigidBody Smoothly 0 Answers
Character movement 1 Answer