Community Forum

Locking a wheel

Forum Overview >> Scripting

Created20.02.2011 22:59

Frederik Jørgensen (Unknown) 20.02.2011 23:00

Is there a function to lock a wheel ? cause i want it like if i press 1 then left wheel should get braked and if i press 2 right should and if 3 both :) but is this possible ? is there a way in the LUA scripting ? like self.setwheel=brake or something :)

Stefan Geiger - GIANTS Software 23.02.2011 15:30
You can brake using the setWheelShapeProps function. You might want to have a look at the Attachable:onBrake function, which just brakes all weels.

The brake a specific wheel (specified with an integer from 1 to number of wheels):
if self.isServer then
local wheel = self.wheels[wheelIndex];
setWheelShapeProps(wheel.node, wheel.wheelShape, 0, brakeForce, wheel.steeringAngle);

Note: Log in to post. Create a new account here.