Search Unity

[C#] HoverCraft script

Discussion in 'Scripting' started by Chefty, Nov 30, 2015.

  1. Chefty

    Chefty

    Joined:
    Jun 17, 2015
    Posts:
    43
    Hey all !

    I know there is already a lot of threads about this subject but no one really helps me to make a great and realistic HoverCraft script.

    Here are two example of what i'm trying to do:



    Does somebeody know where i can find a script which make a similar result ?

    Best regards. ;)

    F.C
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    There's a few posted on forums so do a forum search :) you could even use wheel colliders if you wanted (they're essentially the same thing - raycast + suspension)
     
  3. Chefty

    Chefty

    Joined:
    Jun 17, 2015
    Posts:
    43
    Thank you for the answer !

    Sorry, I forgot to said that i already tried to made this kind of script myself, but adapted to my game, let me explain:
    I work on a 3D "runner" game, the vehicle go right ahead and is only able to translate left/right (without Y axis rotation).
    The vehicle accelerate automatically, so i use up/down keys to translate on Y axis (with addforce).

    Example:


    As you can see at the end, my vehicle collide with the terrain and addforce function push it up hardly, its not really smooth and realist... :(

    Do you have any idea how to get a proportional addfoce when i'm near of the ground or too high to avoid out of map issue ?
    Even with wheel collider it's not smooth... :confused:

    PS: i've added the C# script.
     

    Attached Files:

    Last edited: Nov 30, 2015
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    jenful likes this.
  5. tedthebug

    tedthebug

    Joined:
    May 6, 2015
    Posts:
    2,570
    This might help as well
     
    TonCoder, Chefty and Kurt-Dekker like this.
  6. Chefty

    Chefty

    Joined:
    Jun 17, 2015
    Posts:
    43
    Hey !

    The video tutorial about resolve my problems. :)

    Thank you all ! ;)