Riferimento API di nanos world Documentazione italiana non ufficiale
Documentazione ufficiale
Funzione Server Moderato

VehicleWheeled:SetWheel

Wheels can be updated in runtime by calling SetWheel again, you can for example change the suspension high or disable a wheel totally by toggling affected_by_engine off or setting radius to 0.

Non ancora tradotto

Sintassi

Lua
my_vehicle_wheeled:SetWheel(index, bone_name, radius = 32, width = 20, max_steer_angle = 50, offset = Vector(0, 0, 0), is_affected_by_engine = true, is_affected_by_brake = true, is_affected_by_handbrake = true, has_abs_enabled = false, has_traction_control_enabled = false, max_brake_torque = 1500, max_handbrake_torque = 3000, cornering_stiffness = 1000, side_slip_modifier = 1.0, friction_force_multiplier = 2.0, slip_threshold = 20.0, skid_threshold = 20.0, suspension_spring_rate = 250.0, suspension_spring_preload = 50.0, suspension_max_raise = 10.0, suspension_max_drop = 10.0, suspension_smoothing = 0.0, suspension_damping_ratio = 0.5, suspension_wheel_load_ratio = 0.5, suspension_axis = Vector(0, 0, -1), suspension_force_offset = Vector(0, 0, 0), suspension_sweep_shape = SuspensionSweepShape.Raycast)

Parametri

Nome Tipo Predefinito Descrizione
index integer Index of the wheel (0-N). Set it in ASC order
bone_name string Name of the bone to attach this wheel to
radius facoltativo integer 32 Radius of the wheel
width facoltativo integer 20 Width of the wheel
max_steer_angle facoltativo integer 50 Steer angle in degrees for this wheel
offset facoltativo Vector Vector(0, 0, 0) If bone_name is specified, offset the wheel from the bone's location. Otherwise this offsets the wheel from the vehicle's origin
is_affected_by_engine facoltativo boolean true Whether engine should power this wheel
is_affected_by_brake facoltativo boolean true Whether brake should affect this wheel
is_affected_by_handbrake facoltativo boolean true Whether handbrake should affect this wheel
has_abs_enabled facoltativo boolean false Advanced Braking System Enabled
has_traction_control_enabled facoltativo boolean false Straight Line Traction Control Enabled
max_brake_torque facoltativo integer 1500 Max brake torque for this wheel (Nm)
max_handbrake_torque facoltativo integer 3000 Max handbrake brake torque for this wheel (Nm). A handbrake should have a stronger brake torque than the brake
cornering_stiffness facoltativo integer 1000 Tyre Cornering Ability
side_slip_modifier facoltativo float 1.0 Wheel Lateral Skid Grip Loss, lower number less grip on skid
friction_force_multiplier facoltativo float 2.0 Friction Force Multiplier
slip_threshold facoltativo float 20.0 Wheel Longitudinal Slip Threshold
skid_threshold facoltativo float 20.0 Wheel Lateral Skid Threshold
suspension_spring_rate facoltativo float 250.0 Spring Force (N/m)
suspension_spring_preload facoltativo float 50.0 Spring Preload (N/m)
suspension_max_raise facoltativo float 10.0 How far the wheel can go above the resting position
suspension_max_drop facoltativo float 10.0 How far the wheel can drop below the resting position
suspension_smoothing facoltativo float 0.0 Smooth suspension [0-off, 10-max] - Warning might cause momentary visual inter-penetration of the wheel against objects/terrain
suspension_damping_ratio facoltativo float 0.5 Suspension damping, larger value causes the suspension to come to rest faster [range 0 to 1]
suspension_wheel_load_ratio facoltativo float 0.5 Amount wheel load effects wheel friction. <br/> - At 0 wheel friction is completely independent of the loading on the wheel (This is artificial as it always assumes even balance between all wheels) <br/> - At 1 wheel friction is based on the force pressing wheel into the ground. This is more realistic. <br/> - Lower value cures lift off over-steer, generally makes vehicle easier to handle under extreme motions.
suspension_axis facoltativo Vector Vector(0, 0, -1) Local body direction in which where suspension forces are applied (typically along -Z-axis)
suspension_force_offset facoltativo Vector Vector(0, 0, 0) Vertical offset from where suspension forces are applied (along Z-axis)
suspension_sweep_shape facoltativo SuspensionSweepShape SuspensionSweepShape.Raycast Wheel suspension trace type, defaults to ray trace