Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
# This guide will change according to the development
To start creating a car you need as following:
Unity3d (currently we use Unity 2017.4 LTS) You can download it from here link to the installer
gCarEditor (our asset for unity3d) https://github.com/gRally/gCarEditor/releases This is our asset with tools to define the car (physics, 3d stuff) You have just to download the last one with the higher version number
in this link you can find the 'unity car' project example to use with gRally.. is not full working (for example the interiors, the lights are not full managed), but the chassis, wheels, livery, sound, phyiscs are fully functional.
We will not explain how to use Unity3d. We recommend to learn the interface and the basic operations using the official learning resources. You'll find here https://unity3d.com/learn/tutorials
It's strongly recommended to take a look at the "interface&essentials" video section.
Now just a quick tour about Unity3d environment. Launch it and you'll see something like this
Click con "New" button and you'll have this
- Insert the project name
- Insert the folder where you like to store it;
- Make sure 3D template is selected;
- Leave OFF Enable Unity Analytics;
- Click Create project;
Probably when you'll start Unity3d you'll have a different interface layout, don't worry you can rearrange it as you prefere dragging the single panel in the position you feel more confortable.
According to this layout, here a brief panels explanation:
- The Scene panel (CTRL+1). Here is the editing scene, where you can see your objects, select, move, etc..
- The Game panel (CTRL+2). Here is shown your game when is launced clicking play.
- The Console panel (CTRL+Shift+C). Here you can see the errors, warnings or message about everything is running both in editor mode and in game mode.
- The Hierarchy panel (CTRL+4). Here you can see the tree view of your scene with all the gameobjects of the scenes.
- The Project panel (CTRL+5). Here you can see the folders of your project (the same folder/files hierarchy that you see in windows explorer inside the project root folder you choosen in point 2 of the previous step.).
- The Inspector panel (CTRL+3). Here you can see and edit all the GameObject properties.
In Unity3d, a GameObject is the name of everything you place into a scene: can be a light, a camera, a 3d mesh or something else.
Before adding the gRally tools I suggest you to set some project settings in order to have the best match in terms of visual preview with the game. This step is ** strongly recommended** but not necessary.
Go to Unity menu Edit-> Project Settings
Select "Player" and scroll to "other settings".
Change Color Space to "Linear".
Then, again from the Project Settings, go to "Quality"
In this category you can set quality levels for the different quality levels. We suggest to start, to change the "Ultra" level as following and leave the others as they're set.
- AntiAliasing -> Disabled
- Shadow Cascades -> Two Cascades
- V-Sync Count -> Don't Sync
After this, from Project Settings select "Graphics", uncheck the "use defaults" in the "Low (Tier1)"
From the Tier1 settings, just change "Rendering path" to "Deferred".
Ok. Now you are ready to add gCarEditor
The first thing to do is to install gCarEditor package: download from the Prerequisites section at the top of this page.
After from Unity3d go to Assets ->Import Package ->Custom Package.. and choose the downloaded file :
Make sure to have all the items checked and click Import.
Now you have a new folder called gCarEditor into your Assets folder:
Please, leave the gCarEditor folder tree as you get from import or future upgrade. It'll be easier for us to help you for any problem about it.
1. Prepare the workplace
After the installation the first thing to do is to prepare the requisities to define a car;
To do this, simply go to the
Click on: 1. Create default car data 2. Create car tree
The default car data contains some info about the car, like the name, brand, traction, description:
The "car tree" creates everything you need to build a car (a skeleton, to be edited and improved later) to have a working car for gRally;
- Wheel base: the distance in meters from the front axle and the rear axle;
- Track/tread (front): the distance in meters between the front left and the front right wheel (center);
- Track/tread (rear): the distance in meters between the rear left and the rear right wheel (center);
- Wheel size (front): the commercial size of the front wheels;
- Wheel size (rear): the commercial size of the rear wheels;
⚠️ all these settings are editable later, but is better set these this time 'cause each parameter affect different settings;
once you created the car tree, you can see the
RallyCar gameobject with all the child needed;
To this sample I used this car: https://www.assetstore.unity3d.com/en/#!/content/69324
The car mesh must be aligned with Z positive in front and the center must be in the rear axle:
The car meshes needs to be placed under these gameobjects:
- RallyCar/Body/Common for the meshes that must be seen in exterior and in interior view;
- RallyCar/Body/Ext for the meshes that must be seen only in exterior view;
- RallyCar/Body/Int for the meshes that must be seen only in interior view;
In my example, you can see that the car is rotated by 180° and not centered to 0.0.0 to the rear axle.. we can move and rotate directly from unity to have the right position/orientation. ⚠️ the
Common gameobject must be in 0.0.0 and not rotated, please rotate only the childs.
The wheel meshes must be placed under these gameobjects:
And same like the car body, you can move/rotate the mesh but only the child, not the gameobject listed above;
Here I placed the basic meshes in the right place.
The most important material is the car body material, go on choose it (selecting from the car body mesh):
This material must use the
gRally/grsCarTemporary2 shader and must have these textures:
- Template: a transparent png with only the items that must be added over the livery: like the emergency decal, the door handles, the window seals, the windscreens, the grids, etc...
- Decals: leave it blank, it's added automatically;
- Ambient occlusion: ao for the body or white if you don't have one;
- Metallic: RGB => Specular, A => Smoothness;
Normal: the normal map: if you don't have one, there's a texture called
The GameObject that contains the sounds is
The first elements are for the shift and brake sounds;
Next, there are External and Internal sections: the only difference is that the External sounds are heard when the camera is outside the car and Internal when you're inside the car; The Power and the Coaster section has the availiabilty to add many sounds, to be mixed together to have a more realistic output sound: The mix is managed with the 2 curves: Volume and Pitch;
The Pitch usually is a linear curve, where in the x axis there's the ratio between the rpm and rpm max, and the y axis has the pitch (1.0 is the natural sound recordered);
The Volume is a curve where in the x axis (like the Pitch) there's the ratio between the rpm and rpm max, the y axis has the gain of the sound item;
After the two sections (Power and Coaster) that should have many items, there are 3 optional audio: Reverse, Idle and MaxRPM.. the curves are managed like above; ⚠️I suggest to use max 2 sounds mixed each time.