- Home /
Wheel Colliders & Jumping.
So I'm back, with a new question.
Somehow the following script doesn't seem to work with Wheel Colliders:
if (Physics.Raycast(transform.position, -transform.up, 2)) { grounded = true; } else { horMovement = airModifier; forwardMovement = airModifier; grounded = false; }
//jump if the user pressing the space key AND our character is grounded
if (Input.GetKeyUp(KeyCode.Space) && grounded)
rigidbody.AddRelativeForce(transform.up * jumpForce, ForceMode.Impulse);
I first thoug it could be my gameobject but I checked several times for this. Somehow the Wheel Colliders is interfering with my raycast script. Any ideas? Do I have to rewrite the whole thing, to match the Colliders or is there a simple, faster way to do so? :)
Thanks for taking the time to read this! :)
Your answer
Follow this Question
Related Questions
How to Display high score using GUIText 0 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Loading parts of file (Multiplatform) 0 Answers
Mouse Swipe and Code Efficiency 0 Answers