Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

tyre Set-up

Discussion in 'External Tools' started by joacoerazo_legacy, Apr 14, 2006.

  1. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Hi to all,

    Do you know how to set up the tyres of the car in Maya? I mean, I need that the tyres turn when the car is moving and then, when the car stops, the tyres stop they turn.

    Have I to make the tyres apart? in a separate file an then, attach to the main model?

    Can I made the entire car within Maya and use it insite Unity with that feature?

    Thank you in advance
     
  2. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    I think you mean tires? :wink:

    You should be able to just make them a seprate object in the same scene. I think that a lot of games dont actually rotate the tire, but instead they put a ainimated texture on the tire and controll the speed of the animation. Then you use ray casts instead of rigid bodys for the tire physics.

    Btw, does maya support animated textures? ...haven't tried.

    Bill
     
  3. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Hi Sync1b,

    Yeah tires, sorry for that. :oops:

    Maya supports animated textures (I think) but I don't know what is "ray casts". can you explain me?

    thank you in advance
     
  4. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Heh, no prob. My spelling is usually less then par. :D

    A ray cast is just a line that is casted from one point to any direction. You can check out rays here. You use ray casts for a lot of things, but in your case I think you would cast a ray down from each wheel origin and based on the distance place the car at the appropriate height from the ground. Check out RaycastHit for all the things that can be done with rays.

    Hope that helps.

    Bill
     
  5. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Actually ignore that first link this is what you want.

    Bill
     
  6. tsphillips

    tsphillips

    Joined:
    Jan 9, 2006
    Posts:
    359
    "Tyre" is the UK spelling of the American word "tire." Alternatively, "tire" is the American spelling of the English word "tyre." :wink:
     
  7. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Oh really? wow... had no idea. Sorry then joacoerazo. :D

    Bill
     
  8. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Hi syncb1 and tsphillips,

    Thank you for the info, is very helpfull for a non English speaker this tips.

    About the topic, if I use the the animated texture, it will hide my low poly mesh as if I use a rotating object?

    Thank you in advance.
     
  9. guategeek_legacy

    guategeek_legacy

    Joined:
    Jun 22, 2005
    Posts:
    659
    would it not be better on performance to just have the tire object rotate with a script? Because an animated texture is going to take up more VRAM?

    No worries on not being a native english speaker, I am and non-native english speakers correct me left and right.
     
  10. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Uh, yeah actualy your probably right jeff. I have just had animated textures on the brain lately :p

    Bill
     
  11. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Hi Outcast,

    Thanks for the ad, how the script looks like? There is a sample script in unity? or a prefab?

    Thank you in advance
     
  12. guategeek_legacy

    guategeek_legacy

    Joined:
    Jun 22, 2005
    Posts:
    659
    Yoggy could aid us here :p
     
  13. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,325
    Yoggy is straight up using physics on his car... The rotation on the wheels "is" the movement.

    I think a RayCast solution with another script that rotates the wheels accordingly is the answer. Animated textures on the tire is crazy right now with Unity (until they integrate some QT compression).
     
  14. guategeek_legacy

    guategeek_legacy

    Joined:
    Jun 22, 2005
    Posts:
    659
    So just have the rotate script like yoggy but make sure the tire has no colider and then do the ray casting to position the vehicle? Jeff
     
  15. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,325
    Yoggy has a bunch of primitive Rigidbody Colliders (boxes) around his wheels and he's using that friction to move his car. It works great for his "all terrain" approach. Nicholas said at some point that most driving games use Raycasting to determine where the car is situated on the ground.

    So maybe setting up a script that rotates the wheels in relation to the speed of the car would look realistic.
     
  16. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    Yeah, I think thats the way to go. You should remember to use physics on cars body dont place the car exactly x above the ground. Just have a minimum distance (being the diameter of the tire) that the car can be off the ground. Rotate the wheel like antenna said, and you off to making a sweet car. Should handle well too. Cant wait to see

    Bill
     
  17. joacoerazo_legacy

    joacoerazo_legacy

    Joined:
    Apr 5, 2006
    Posts:
    214
    Thank you guys,

    Iĺl try all your sugestions as fast as I can.
    If you have any idea how these script look like let me know.