Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Wipeout style vehicle

Discussion in 'Scripting' started by MrStu, Mar 27, 2009.

  1. MrStu

    MrStu

    Joined:
    Mar 20, 2009
    Posts:
    5
    Hi

    I've search and posted but can't find a way of doing this smoothly. Basically you're looking at a vehicle that hovers within a fixed range of distance from a track. The track could twist, turn or go upside down, but the vehicle will hover that certain distance from it, and aligned so that the bottom is pointing toward the track.

    It needs to be springy to avoid the thing rattling around when a new track poly goes underneath it, and the ship will need to rotate a bit for turning.

    Now, I've tried several methods (including the faux gravity script that's knocking around here. basically it looks like I'll need projected colliders pointing down from the front and back of the vehicle but it's looking very messy, and I'm still having trouble getting the thing to turn, has anyone already worked on this kind of thing before with Unity? Has anyone got any pointers?

    thanks for any help, I'm about a week into the trial and trying to get to grips with ide
     
  2. Dakta

    Dakta

    Joined:
    Apr 8, 2008
    Posts:
    492
  3. zelk

    zelk

    Joined:
    Mar 13, 2009
    Posts:
    246
    I think you should try the WheelColliders. It sounds wierd but they are actually implemented as just rays from the center of the wheels. You should set all friction to 0 and just use the build in spring and damping. You could try to offset the center of mass a few meters below the vehicle to decrease the risk of falling over. Then you use AddForce to accelerate and break... and you use AddForceAtPoint behind or in front of the center of mass to turn your hovercraft.

    I tried the WheelColliders for a car and that is NOT recommended since the friction model seems to be sloppy. But for your hovercraft without wheel friction, it should be fine.