tyVehicleTurretBarrel Helper

The tyVehicleTurretBarrel helper defines a barrel attached to a tyVehicleTurret, which can pivot vertically, fire projectiles (when enabled in a PhysX Vehicle operator’s Projectiles rollout), and recoil on firing.

tyVehicleTurretBarrel helpers are created from a tyVehicleTurret helper, not from the Create panel.


Dimensions

  • Length/radius: the dimensions of the barrel.

Pressing the “transform” button will temporarily sever the parent/child relationship between the helper and its children (ex: meshes parented to it), allowing you to move/rotate/scale the helper without affecting its children. This allows you to do things like reposition the helper without moving its children with it. Depressing the “transform” button will restore the prior parent/child relationship.

The “fit…” menu has options which allow you to match the position/orientation/scale of the helper to its child meshes.

The “flip” button will flip the transform of the helper along its dominant axis, without affecting its children.

Pivot

  • Min/max range: the minimum (downward) and maximum (upward) pivot angle limits of the barrel.

  • Accel/decel response: controls how quickly the barrel’s pivot speed changes toward its commanded speed, rather than changing instantly.

  • Speed: the barrel’s pivot speed.

  • Gyro strength: controls how strongly the barrel resists being disturbed by the chassis’s own motion (bumps, sharp turns, etc), simulating gyroscopic stabilization. Higher values keep the barrel more steadily aimed regardless of chassis movement.

PhysX

  • Mass: the mass of the barrel’s rigid body.

  • Stiffness/damping: the stiffness and damping of the joint connecting the barrel to the turret.

Convex hull
  • Convex hull mode: controls which geometry is used to generate the barrel’s collision hull.

From helper: the convex hull of the barrel will be generated from the helper’s stand-in geometry.

From linked meshes: the convex hull of the barrel will be generated from the meshes parented to the barrel.

  • Split mesh elements: when enabled, separate mesh elements within the specified hull geometry will be used to create a compound collider composed of multiple convex hulls, rather than being combined into a single hull.

Recoil

  • Distance: the maximum distance the barrel recoils backward on firing.
PhysX
  • Impulse: the strength of the recoil impulse applied to the barrel on firing.

  • Stiffness/damping: the stiffness and damping of the spring that returns the barrel to its resting position after recoiling.

Affect
  • Recoil affect mode: controls which children parented to the barrel helper will be affected by the recoil.

A projectile-firing barrel may be segmented into different parts, only some of which undergo shock-absorption/recoil when a projectile is fired (despite all of the parts following the overall pivot motion of the barrel). By changing the recoil affect mode to “recoil affects specified children”, you can specify which children of the barrel will be affected by recoil, while all other parented parts will not.

Recoil affects all children: every child parented to the barrel helper will be affected by the recoil.

Recoil affects specified children: only the barrel children specified in the affect list will be affected by the recoil.

Interactive control

Keyboard
  • Pivot up/down: assigns the keyboard key used to manually pivot the barrel in each direction.

  • Fire: assigns the keyboard key used to fire this barrel.

You can click the “assign key by key press” button next to any key setting, followed by pressing the desired keyboard key, in order to quickly re-assign keys, rather than having to manually find the desired key in the associated dropdown menu.