The PhysX Vehicle AI operator allows you to assign rule-based controls to PhysX vehicles.
The PhysX Vehicle AI operator controls vehicles initialized by a PhysX Vehicle operator. Vehicles with cached inputs will be ignored by the PhysX Vehicle AI operator.
Nearest object: vehicles will attempt to move toward the nearest object in the object list.
Target particle: vehicles will attempt to move toward the specified target particle.
Spline follow: vehicles will attempt to follow along the specified spline(s).
Spline list: the list of splines to use as vehicle goals, when goal mode is set to spline follow.
Spline resolution: the number of samples used to approximate each spline, when calculating the nearest point along it. Higher values improve accuracy on splines with tight curves.
Look ahead: the distance ahead of the vehicle’s current position along the spline used to determine its immediate steering target, rather than steering directly at the nearest spline point.
Min/max distance: the min/max perpendicular distance from the nearest point on the spline, within which a vehicle’s goal will be bounded. A min/max value of 0.0 means the vehicle’s goal will be set to an exact point on the spline.
Extrapolate open splines: when enabled, vehicles that reach the end of a non-looping spline will continue to be guided along its extrapolated direction..
Follow spline direction: when enabled, vehicles will follow the spline’s knot-order direction (first-to-last knot ordering) rather than toward whichever end is aligned to its forward chassis direction.
Determines when a vehicle is considered to have gone off-course, so corrective steering behavior can engage.
Angle: the angle, relative to the vehicle’s goal direction, beyond which the vehicle is considered off-course.
Time: how long the vehicle must remain beyond the angle threshold before it’s considered off-course.
Goal noise perturbs a vehicle’s steering target with noise, producing more organic, less robotic goal-seeking behavior.
Smoothing here uses a stiffness/damping spring model, rather than a simple ramp rate - this allows steering response to naturally vary with how far off-target the vehicle’s current heading is, rather than always changing at a fixed rate.
Stiffness: how strongly the smoothed steering value is pulled toward the AI’s actual commanded steering angle.
Damping: how strongly changes in the smoothed steering value are resisted, reducing overshoot/oscillation.
Min/max velocity: controls the velocity range within which smooth steering will be applied. If a vehicle’s velocity is below the min threshold, smooth steering will not be applied. If a vehicle’s velocity is above the max threshold, smooth steering will be fully applied.
Collision avoidance lets vehicles automatically steer around obstacles (PhysX colliders or other vehicles) detected via raycasts, without needing to be routed around them manually via goal placement.
Object colliders may be added to the sim with a PhysX Collision operator. The PhysX Collision operator must be in the same event as the vehicle chassis rig particle being controlled by the AI, in order for the AI to detect collisions with it.
Enable collider avoidance: when enabled, vehicles will cast rays around themselves and steer to avoid detected obstacles.
Raycast count: the number of raycasts fanned out around the vehicle used to detect obstacles. Higher values improve detection accuracy and coverage at the cost of performance.
Look-ahead distance: the maximum distance ahead of the vehicle that obstacle raycasts extend to.
Minimum slope: the minimum slope angle, relative to the ground, that a detected surface must have before it’s treated as an obstacle to avoid, rather than driveable terrain.
Smooth avoidance: when enabled, changes to avoidance-driven steering are smoothed using the settings below, rather than being applied instantly.
Stiffness: how strongly the smoothed avoidance value is pulled toward the actual detected avoidance steering value.
Damping: how strongly changes in the smoothed avoidance value are resisted, reducing overshoot/oscillation.
Use tyIcon helpers (in “box” mode) to define boost zones - AI-controlled vehicles passing through them will have various parameters boosted (ex: throttle, max velocity, etc), using the boost settings defined in that tyIcon’s PhysX Vehicle AI rollout. For example, if you have AI-controlled vehicles driving up to a ramp and you want them to accelerate up the ramp in order to launch off the end of it, you can place a boost zone on the ramp and increase its throttle/velocity/torque multipliers. When an AI-controlled vehicle enters the zone, it will apply those multipliers automatically and remove them when it leaves the boost zone.