Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Heratitan · Sep 19, 2010 at 07:21 PM · car-tutorialwheel-collider

Car moves only when the wheels have no colliders

So far in my project right now I have been trying to create a driving game with my own car model using the unity car tutorial. At the moment I am using the wheels from the car model from the tutorial (because I was having problems with the ones I had modeled) but I am still running into problems. The problem right now is that when the rear wheels have no colliders I can move the car and everything goes normally (aside from the wheels going through the ground because they have no colliders), and when have colliders the nothing happens and the car does not move and the wheels do not rotate(also I can hear the sound affect of the car diving).

Does anyone know what could be happening?

Thanks.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Edy · Nov 30, 2010 at 01:13 AM

The Car Tutorial is a bad starting point, IMHO. The car controller script (Car.js) is obfuscated and specifically designed to work in this exact project, not as generic vehicle control script one can reuse or learn from. It doesn't use the WheelColliders from the model, but it creates its own GameObjects and WheelColliders at runtime! So its very difficult to keep track on what and how the script does anything.

What seems to be happening in your case is that when your model has no WheelColliders, the ones created inside the script work properly moving the car. When you add your own WheelColliders to the model, then they are surely 'lifting' the car so the runtime WheelColliders don't reach the ground - thus the sound and everything else works, but the car doesn't move.

My recommendation is to follow this tutorial instead:
http://carpe.com.au/slawia/2009/08/unity-wheel-collider-introduction/

If you need something working to start from, you may check out my vehicle physics here:
http://forum.unity3d.com/threads/47366-New-Unity-Car-Tutorial-GTA4-Vehicle-Replica-Project-4050?p=414127&viewfull=1#post414127

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by spinaljack · Sep 19, 2010 at 08:45 PM

The WheelColliders are actually raycasts, the don't spin or have any sort of size or shape in the physics engine. All they do is produce force proportional to the friction value and distance to the floor. (like a hovercraft or jet engine)

If you put a collider on the wheel model it'll either block the ray casts or get stuck on things preventing the car from moving.

What you need to do is set a higher suspension height and radius on the wheel colliders so that the model appears to be over the ground.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Wheel collider in the air problem 0 Answers

Alternate Physics - Car tutorial - how to avoid car slipping? help please 1 Answer

Can i use Unity' tutorial car in my game? 2 Answers

Tire deformation? 0 Answers

2 Scripting Errors I need help fixing!! 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges