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 Siccity · Sep 17, 2014 at 11:49 PM · physicscarsimulationfrictionwheel

Square wheels

I know how to use wheelcollider, but how would one go about creating a car with square wheels instead of round? The wheels would need to be capable of different grip settings, and also work with other shapes like triangle and round.

Square wheel image

squarewheels.jpg (155.2 kB)
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

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by GraviterX · Sep 18, 2014 at 12:05 AM

It depends on what you want to do. If you want the car to drive on it's own, then I would recommend using an animation, that way you could edit how the wheels move. If you want the player to move it, I would recommend playing with colliders. I haven't done anything like this so I'm sorry if I'm not specific. Hope this helps.

Comment
Add comment · Show 1 · 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 Siccity · Sep 18, 2014 at 09:55 AM 0
Share

I am speaking of a drivable vehicle with motor, and animation is not an option since the wheels will have to collide correctly with bumpy terrain

avatar image
0

Answer by Cherno · Sep 18, 2014 at 12:14 AM

The wagon would move up and down as the square wheels turn, so you can just determine the wagon's y offset from the transform.rotation.eulerangles of one of the wheels (assuming that they all turn the same). I would keep a root object on ground level and make the wagon a child of it, so it can move up and down without changing the actual position of the object.

In essence, you would rotate the wheels by code depending on speed, and don't give them any actual colliders with rigidbodies that react with the ground. The forward and backward movement of the wagon would still be accomplished by rigidbody and velocity setting, but it just needs a normal box colider with flat bottom that sits on the ground.

Comment
Add comment · Show 1 · 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 Siccity · Sep 18, 2014 at 10:00 AM 0
Share

The wheels do not necessarily allign, in fact they might not even all be of same shape. The whole point of the odd wheels is to navigate a terrain with obstacles and such with non-generic wheels. Realistic physics is of top priority

avatar image
0

Answer by Kiwasi · Sep 18, 2014 at 10:12 AM

This could be achieved with a hinge joint (in 3D physics anyway). Simply place the hinge at the center of the wheel with the anchor facing into the vehicle. Use add torque to make them turn. If you really wanted you could attach these to an axel and add suspension with spring joints.

To be realistic your square wheeled vehicle won't be moving very fast. You probably don't need all of the fancy high velocity stuff a wheel collider provides.

Comment
Add comment · Show 1 · 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 Siccity · Sep 18, 2014 at 11:49 AM 0
Share

This sounds more like what I need. I've been messing with hinge joints and they all seem sort of "sloppy", as in the wheel appears to be mounted on a rubber band contraption. Can you upload me a simple example on how to do it?

avatar image
0

Answer by ViCoX · Sep 18, 2014 at 01:04 PM

This is an idea not the implementation. Heres example You could raycast from bounding box vertices to the ground collider. Get the closest point and get its difference and match the box wheel to the ground. Then make it rotate so that it spins on the ground? I haven`t tested this so hard to say the best solution. : ) I hope it helps.

Comment
Add comment · Show 1 · 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 Siccity · Sep 19, 2014 at 08:04 AM 0
Share

Again, this would look nice but wouldn't quite pull off on a bumpy terrain

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

27 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Strange behaviour when WheelColliders are on their side. 0 Answers

2D anisotropic friction weirdness 1 Answer

2D Joint/Wheel Question 1 Answer

Static and kinetic friction on wheel collider 0 Answers

using inertia tensor vector instead of inertia matrix 1 Answer


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