Setting up custom collider.kn5 & colliders.ini
Posted: Sun May 21, 2023 9:26 am
AC collisions suck. There is not much you can do about them, but you can mitigate the problem by at least having your colliders set up properly.
The KN5 collider is used by ground collisions, wall collisions and car contact collisions.
Prerequisites:
Because different 3D programs use different notations for the axises, at some point in the pipeline from FBX to AC, the model gets rotated 90 degrees. This is why colliders come out wonky/incorrectly rotated at times. To counter this, do:
First rotate the collider model -90 degrees on the X axis. CTRL + A to apply rotation transform. Also apply scale transform, if you have those.
Then rotate the model +90 degrees on the X axis. Your collider model should now have origin 0,0,0 rotation 90,0,0 and scale 1,1,1. Your collider should now export with the correct alignment. Step 4. Add material. The material name can be whatever you want. Step 5. Exporting and kseditor.
Use these export settings and everything should go fine. MAKE SURE YOUR COLLIDER OBJECT IS THE ONLY SELECTED OBJECT IN YOUR SCENE (ORANGE WIREFRAME). In Kseditor make the collider object active and select material GL. Export KN5 (car) and name it collider.kn5
Step 6. Complete(?)
If you have worked with a Kunos pipeline compliant car that has been aligned correctly, this is where the guide ends. Your collider lines up with the car in CM, everything is fine. (Do note, that basey and visual offset rotation in car.ini may affect the rake of your collision model.)
As you can see the collider shape has changed from the last time we saw it. But it appears something is not adding up! My friend Tes has been slipping and has not aligned the car to be above 0 cordinate on the Y axis!!!! So the collider turns out slammed to the ground, as the collider function in AC always assumes the model is correctly aligned above the 0 cordinate.
This is a simple fix:
Re-open Blender (you DID save your blend, RIGHT?)
Select all (press A twice) and drag everything up until the tire lines up with the green axis. After this, Apply the location transform (CTRL + A). DO NOT APPLY ROTATION OR SCALE AGAIN.
After this, repeat instructions in step 5. Now you should have a working 3d collider! And it only took you 1 hour and 32 minutes. Colliders.ini
Colliders.ini are simple box colliders that only collide with road surfaces. These are useful for things like collisions for front splitters, diffusers, or squat-plates.
For a simple road car application, just make the collider span the general bounds of the floor of the car. Collider thickness does not need to be more than 0.1.
The KN5 collider is used by ground collisions, wall collisions and car contact collisions.
Prerequisites:
- Blender3D
- Basic knowledge of Blender controls.
- Kseditor
- CM with developer mode enabled.
- A car
Because different 3D programs use different notations for the axises, at some point in the pipeline from FBX to AC, the model gets rotated 90 degrees. This is why colliders come out wonky/incorrectly rotated at times. To counter this, do:
First rotate the collider model -90 degrees on the X axis. CTRL + A to apply rotation transform. Also apply scale transform, if you have those.
Then rotate the model +90 degrees on the X axis. Your collider model should now have origin 0,0,0 rotation 90,0,0 and scale 1,1,1. Your collider should now export with the correct alignment. Step 4. Add material. The material name can be whatever you want. Step 5. Exporting and kseditor.
Use these export settings and everything should go fine. MAKE SURE YOUR COLLIDER OBJECT IS THE ONLY SELECTED OBJECT IN YOUR SCENE (ORANGE WIREFRAME). In Kseditor make the collider object active and select material GL. Export KN5 (car) and name it collider.kn5
Step 6. Complete(?)
If you have worked with a Kunos pipeline compliant car that has been aligned correctly, this is where the guide ends. Your collider lines up with the car in CM, everything is fine. (Do note, that basey and visual offset rotation in car.ini may affect the rake of your collision model.)
As you can see the collider shape has changed from the last time we saw it. But it appears something is not adding up! My friend Tes has been slipping and has not aligned the car to be above 0 cordinate on the Y axis!!!! So the collider turns out slammed to the ground, as the collider function in AC always assumes the model is correctly aligned above the 0 cordinate.
This is a simple fix:
Re-open Blender (you DID save your blend, RIGHT?)
Select all (press A twice) and drag everything up until the tire lines up with the green axis. After this, Apply the location transform (CTRL + A). DO NOT APPLY ROTATION OR SCALE AGAIN.
After this, repeat instructions in step 5. Now you should have a working 3d collider! And it only took you 1 hour and 32 minutes. Colliders.ini
Colliders.ini are simple box colliders that only collide with road surfaces. These are useful for things like collisions for front splitters, diffusers, or squat-plates.
For a simple road car application, just make the collider span the general bounds of the floor of the car. Collider thickness does not need to be more than 0.1.