Vehicle Wrapper -- Blender 3D Game Engine


 


 
1.  Tweaking the suspension is optional

If you don't set the values for:

Tire Grip
Suspension Compression
Suspension Damping
Suspension Stiffness
Roll Influence

the default values will be used.
 
  
2.  Add Suspension.py to the Text Editor

Note:
Optional.  If you don't add Suspension.py, the default values for the suspension will be used.

Note:
If you downloaded the starting blend, you can find Suspension248.txt and Suspension249.txt in the Text Editor.  

Download:

Text Editor menu >> Text >> Open
Rename Suspension.txt to Suspension.py

 
  
3.  Suspension.py ---  Tire Grip  (Line Numbers:  51 - 63)

Note:
Tire grip can be changed at any time while the game is running.  

Note:
0 = first tire added by AddWheel in CarSetup.py
1 = second tire added by AddWheel in CarSetup.py
2 = third tire added by AddWheel in CarSetup.py
3 = fourth tire added by AddWheel in CarSetup.py

##########################################################

# set tire grip
def Tire_Grip(vehicleID):

    grip_0 = 30.0     # front driver's tire
    grip_1 = 30.0     # front passenger's tire
    grip_2 = 30.0     # rear driver's tire
    grip_3 = 30.0     # rear passenger's tire

    vehicleID.setTyreFriction(grip_0, 0)  # front driver's tire
    vehicleID.setTyreFriction(grip_1, 1)  # front passenger's tire
    vehicleID.setTyreFriction(grip_2, 2)  # rear driver's tire
    vehicleID.setTyreFriction(grip_3, 3)  # rear passenger's tire

 
  
4.  Suspension.py ---  Suspension Compression  (Line Numbers:  66 - 79)

Note:
Suspension compression can be changed at any time while the game is running.  

Note:
0 = first tire added by AddWheel in CarSetup.py
1 = second tire added by AddWheel in CarSetup.py
2 = third tire added by AddWheel in CarSetup.py
3 = fourth tire added by AddWheel in CarSetup.py

##########################################################

# set suspension compression
def Suspension_Compression(vehicleID):

    compression_0 = 6.0     # front driver's tire
    compression_1 = 6.0     # front passenger's tire
    compression_2 = 6.0     # rear driver's tire
    compression_3 = 6.0     # rear passenger's tire

    vehicleID.setSuspensionCompression(compression_0, 0)  # front driver's tire
    vehicleID.setSuspensionCompression(compression_1, 1)  # front passenger's tire
    vehicleID.setSuspensionCompression(compression_2, 2)  # rear driver's tire
    vehicleID.setSuspensionCompression(compression_3, 3)  # rear passenger's tire

 

   
Download free seamless game textures or you can create your own seamless game textures. Use reference photos to add realism to the seamless texture you create. Textures let you create the style and mood for your computer game. Textures are a way to add detail and color to 3D graphics. Photo realistic textures add realism. Download free game models for your video game or create your own game models. Use the game models in First Person Shooter, role playing games, racing simulations and more. Download free textures to add detail to your game models. You can use the free game models you downloaded or model your own game models.