Vehicle Constraint: setSteeringValue

setSteeringValue(amount, wheel)
  • Sets the amount the selected tire turns for steering.

amount:
  • Amount the tire turns.
  • Type:  float
  • 0.1 approximately 10 degrees
  • 0.2 approximately 20 degrees
  • etc.
wheel:
  • Type:  integer
  • 0 = first wheel added
  • 1 = second wheel added
  • 2 = third wheel added
  • 3 = fourth wheel added
Sample Code

################ set the amount the selected tire turns

#import bge
import bge

# get current scene
scene = bge.logic.getCurrentScene()

# get object list
objList = scene.objects

# get vehicle object named car
objCar = objList["Car"]
    
# Retrieve constraint ID you saved as a property when you created the vehicle constraint
constraint_ID = objCar["constraint_ID"]

# get the vehicle
vehicle = bge.constraints.getVehicleConstraint(constraint_ID)
 
# first tire added
wheel = 0

# steering amount
amount = 0.1

set the steering amount
steering_tire = vehicle.setSteeringValue(amount,wheel)