Skip to content
larnin edited this page Jan 30, 2020 · 11 revisions

All the steps on this page are optional and independent.

On this page, some GameObjects needs more custom properties; these properties all follow the same format.

  • A property is defined in the name of a child GameObject. Only the name of the property GameObject is important, don't put anything else as a component or child of this property GameObject
  • The property GameObject name starts with a #
  • Each value of the property is separated with a semicolon (;) without space.
  • For example: #mat;0;transparentglow

Jets and trails

Jets

The jets are the flame effects that are activated when you use the boost, rotation, grip, or wings.
There are 3 different types of jets:

  • BoostJet: Only active when the boost key is pressed.
  • RotationJet: Active on grip and when a rotation direction is pressed.
  • WingJet: Active when wings are opened. Can be set as rotation jets too.

To place a jet, it's really simple; just add an empty GameObject where you want to have your jet, and name it BoostJet, RotationJet or WingJet, depending on the type of jet you want to add.
The name must contain this word, you can add something else on it, like Front rotationJet2.
The jet direction follows the green arrow of the Gizmo when you are in pivot, local mode (see on the top left of Unity).
The global scale of the GameObject affects the scale of the flame; if one of the parents have a scale of 2, then the flame is going to be bigger.
Jets
I usually add a small sphere on this GameObjet to know exactly where I placed it and then remove the sphere later.
For each WingJet and RotationJet, you must set the rotation jet input direction with a property. If not, theses jet will just not works for rotation.

  • #dir;[x];[y];[z]
    • [x][y][z] : 3 axis values or
  • #dir;[direction]
    • [direction] : front, back, left, right
      Theses 4 directions have predifined axis values
      • front: x=-1 y=0 z=0
      • back: x=1 y=0 z=0
      • left: x=0 y=1 z=1
      • right: x=0 y=-1 z=1

Trails

Like jets, trails are empty GameObjects that you name WingTrail and place where you want.
They don't need anything more and are not sensitive to the GameObject rotation.
WingTrails are only active when the wings are open.

Materials

On each renderer, you can customize the materials that are used in Distance, and import custom uniform values.

Material type

To set the material type, you can add a property as a child of each renderer.
#mat;[matindex];[matname]

  • [matindex]: The index of the material on this renderer. The first material have an index of 0.
  • [matname]: The name of the new material in Distance
    carpaint, carwindow, wheel, carpaintbump, interceptor, transparentglow, donotreplace

Each material has a different effect in-game.

  • carpaint: Only supports Diffuse texture, has car dents, splitting, and appear effect.
  • carwindow: Only supports Emissive and Normal map texture, has car dents, splitting, and appear effect.
  • wheel: Supports Diffuse, Emissive and Normal map texture, has splitting, and appear effect.
  • carpaintbump: Supports Diffuse and Normal map, has car dents, splitting, and appear effect.
  • interceptor: Special material that is used on the interceptor, supports Diffuse, Emissive and Normal map, has car dent, splitting, and appear effect. (I never played that car, so I'm not sure if this material has theses effects, but must have it).
  • transparentglow: Transparent material (used on the skeleton car), supports Normal map and Emissive texture, has splitting, and appear effect.
  • donotreplace: Use the material you have set, it doesn't support split, dent, or appear effect.

Material uniforms

If you know what you are doing, you can export custom uniform from your material to the Distance material you have set with the previous property.
For each uniform, you must add one property to your GameObject. #export;[matindex];[type];[fromName/ID];[toName/ID]

  • [matindex]: The index of the material on this renderer. The first material has an index of 0.
  • [type]: The type of the uniform that you want to export
    Color, ColorArray, Float, FloatArray, Int, Matrix, MatrixArray, Texture, Vector, VectorArray
  • [fromName/ID]: The name or ID of the uniform you want to export.
  • [toName/ID]: The name or ID of the uniform on the Distance material where you want to set it.

I will not help you to find what uniform does what on Distance materials, use this uniform exporter only if you know what you're doing.

Animations

Distance has some animations on the car for wings, boost, and rotation. All the animations are optional; if your car doesn't have one animation (for example boost), just don't add it. There are 6 different animation clips, and you must name it exactly like these (case sensitive):

  • BaseAnimation: This animation does nothing, I don't really know when it is played, but I think it must be here if you add other animations; just add an empty animation and it will do the work.
  • BoostOpen: Played when the player starts boosting and holds the last frame until the player stops, and then play it backward.
  • JetsOpen: Same behavior as BoostOpen, played when the player uses the rotation jets and grip.
  • WingsOpen: Same behavior as BoostOpen and JetsOpen, played when the player opens the wings.
  • Assemble: I don't realy know when this one is played, maybe at the start of the campaign, or something like that, some official cars don't have one.
  • Overheat: Played in a loop when the car overheats.

To add animations on the car you need to add an animation component (not an animator, an animation) somewhere in the hierarchy of the car, and having all the GameObjects you want to animate as children (or itself).
Note: The wheels can't be animated; the game takes control of it.
On the animation component, add all your animations clip on the Animations list.
Animations

Create an animation clip

Animations can be imported, or created in Unity.
To create an animation clip, right click on the Project window -> Create -> Animation.
The clip must be marked as Legacy; if they are not, they will simply not work.
To do that, select your animation, and put the inspector to Debug mode.
Legacy animation
When you have set all your animations to Legacy, put the inspector back to Normal mode; it's easier to work with.
I have never used imported animations for Distance, but I think you must mark them as legacy as well.

Add the animation clips on the animation component, and create your animations with the Animation window.
Note: You must select the GameComponent on the scene hierarchy that supports the animation component in order to be allowed to change the animation.
Animation

Configure animations

After you have created and set them on the animation component, you must configure their blend mode with a property object.
Animations can have 2 blend modes:

  • blend: Positions are interpolated between 2 keyframes; animations are created this way in unity.
  • additive: The offset between 2 keyframe is added. Some animations can be imported in this mode.
    It's the default blend mode in Distance.

You have multiple ways to configure blendmode with properties, as child of the GameObject that support the Animation component:
#blend: All the animations are set to blend mode.
#additive: All the animations are set to additive mode.
#[animationName];blend: Set this animation to blend mode.
#[animationName];additive: Set this animation to additive mode.

Default colors

If you don't set the default colors of the car, they will be the same colors as the refractor (grey, white, blue).

To set your default colors, you must create a new child GameObject on the car root GameObject, named DefaultColor.
As a child of this GameObject, you must have 4 property objects, one for each color layer.
#[colorType];[colorEx]

  • [colorType]: The type of the layer.
    primary, secondary, glow or sparkle
  • [colorEx]: The hexadecimal code of the color.
    Just search color picker on google, to find a color tool to create hexadecimal code.

Color changer

You can link the materials of the renders of your car with the color system in the garage.
On each renderer, you can use this property to set some uniform of the materials to the color changer.
#color;[matIndex];[colorType];[uniformName];[multiplier];[alpha]

  • [matIndex]: The index of the material on this renderer. The first material is at the index 0.
  • [colorType]: The type of the color layer, in the Distance garage
    primary, secondary, glow or sparkle
  • [uniformName]: The name of the uniform on the material
    color, color2, emitcolor, reflectcolor, speccolor
  • [multiplier]: How much effect of the color type is applied on the uniform (use 1 if you don't know what to do).
  • [alpha]: Boolean (true/false), Indicates if this color supports alpha (if you don't know, just use true)

If you use a custom imported material, you must have some specific color uniform in order to have the color changer work.
Each [uniformName] has a specific name on the material:

  • color: _Color
  • color2: _Color2
  • emitcolor: _EmitColor
  • reflectcolor: _ReflectColor
  • speccolor: _SpecColor