|
setSuspensionStiffnesssetSuspensionStiffness(stiffness, wheel)Sets the suspension stiffness.stiffness:
Type: float
wheel:
Type: integer
0 = first wheel added
1 = second wheel added 2 = third wheel added 3 = fourth wheel added Sample Code# import PhysicsConstraintsimport PhysicsConstraints# get list of objects in sceneobjList = GameLogic.getCurrentScene().objects# get vehicle named carobjCar = objList["OBCar"]# Retrieve constraint ID you saved when the wheels were attachedconstraint_ID = objCar.constraint_ID# get the vehicle constraintvehicle = PhysicsConstraints.getVehicleConstraint(constraint_ID)# 1st tire added.vehicle.setSuspensionStiffness(8.5, 0)# 2nd tire added.vehicle.setSuspensionStiffness(8.5, 1)# 3rd tire added.vehicle.setSuspensionStiffness(8.5, 2)# 4th tire added.vehicle.setSuspensionStiffness(8.5, 3) |