Processes an array of MechanicalElement blocks targeting distinct cosmetic sub-mesh objects within the prefab hierarchy.
| Property | Description |
|---|---|
| Element Label | A descriptive text string used to organize and name array entries within the Unity Inspector layout for easy modification. |
| Target Transform | The scene reference to the moving sub-mesh geometry container (e.g., a gear, crank, worm screw, bellows, or counterweight arm). |
| Tracking Source | Determines whether the element responds directly to the weapon's vertical pitch (Elevation) or horizontal yaw (Traverse). |
| Drive Mode |
The mathematical behavior calculation type applied to this asset:
|
| Local Axis | The local direction vector (directional mask) along or around which transformation modifications are processed. |
| Multiplier | The physical scaling factor. Serves as a gear ratio multiplier for rotations (in degrees), indicates the maximum travel displacement window for translations (in meters), or maps dimensional extension ratios for geometric scaling. |
Calculates dynamic physics-based sway and downward alignment for objects that must hang freely (counterweights, slings, lanterns).
| Property | Description |
|---|---|
| Label | A string used to identify this specific pendulum. Critical for targeting this element via Unity Events or Animation Events using PausePendulumByLabel. |
| Target Transform | The hanging object that will be driven by the procedural gravity alignment. Should typically be an empty parent transform. |
| Sway Sensitivity | How aggressively the weight swings in reaction to world-space movement. Use negative values to invert the momentum direction. |
| Gravity Tension & Damping | Tension controls how powerfully the object is pulled back toward true downward resting alignment. Damping dictates how quickly the oscillating swing settles to a complete stop. |
| Swing Clamps & Locks | Max Swing Angle X/Z bounds the oscillation limits to prevent clipping through frames. Disable Z Rotation restricts movement entirely to a 2D planar pitch. |
| Animated Child | If the Animator drives a child object (e.g., visual ropes) while this script drives the un-animated parent pivot, assign the child here. Enables perfect positional handoffs when transitioning from pre-baked animations back to procedural physics. |
| Recovery Duration | The duration in seconds used to perform a smooth spherical interpolation (Slerp) from the Animator's final frame back into the procedural downward gravity state, eliminating visual popping. |
Manages automated wheel rotations for mobile platforms, integrating both straight translation metrics and rotational spot-turn deltas.
| Property | Description |
|---|---|
| Left Wheels | An array of transforms representing all wheels assigned to the left track side of the chassis frame structure. |
| Right Wheels | An array of transforms representing all wheels assigned to the right track side of the chassis frame structure. |
| Wheel Diameter | The literal bounding distance of the wheel meshes in meters. This is critical for exact algebraic wheel rolling translations without visual ground slippage. |
| Track Width | The lateral distance measured between the left and right wheel sets. Controls the differential velocity calculations during stationary spot turns. |
Controls the integrated real-time dynamic locomotion loop channel. Audio functions independently of weapon actions to prevent audio cut-offs or clip context overwriting bugs.
| Property | Description |
|---|---|
| Loop Source | Explicit inspector assignment slot for the secondary AudioSource dedicated to structural movement. Populating this ensures that the core weapon script does not overwrite the travel loop during firing sequence calls. If left unassigned, fallback logic hooks an existing secondary source or appends a new one dynamically. |
| Locomotion Loop | The seamless audio asset clip representing continuous chassis translation friction (heavy wood creaking, iron rim grinding, structural straining). |
| Max Audio Speed | The true travel velocity threshold (m/s) at which the looping channel reaches its maximum volume and pitch parameters. Default: 4 m/s. |
| Audio Volume Smoothing | The interpolation factor governing how rapidly the audio's volume and pitch values respond to abrupt velocity adjustments or sudden braking stamps. Default: 5. |
Manages the continuous operational tracking soundscape for turret traversal and barrel elevation adjustments, isolating aiming feedback from discrete action triggers.
| Property | Description |
|---|---|
| Aim Source | Explicit inspector assignment slot for the dedicated aiming AudioSource component. Isolating continuous rotation audio on this channel prevents tracking modifications from disrupting or cutting off primary actions like weapon fire and reloading triggers. If unassigned, an independent instance is generated automatically on initialization. |
| Aim Loop | The seamless looping audio asset clip representing mechanical friction, internal gear grinding, iron crank strain, or structural pressure during active weapon adjustments. |
| Aim Audio Smoothing | The interpolation smoothing speed controlling how dynamically the audio loop scales its volume and pitch envelopes between active tracking and full stops. Prevents sudden audio pops or abrupt cuts. Default: 8. |
PausePendulumByLabel instantly wipes the script's gravity calculation and resets the parent transform to its clean prefab state, allowing the Animator to execute Firing sequences completely unimpeded on the child object.ResumePendulumByLabel, the script isolates the exact world rotation of the animated child mesh on the final frame of the animation clip. It then applies a SmoothStep spherical lerp over the defined Recovery Duration, melting the pre-baked animation follow-through flawlessly back into dynamic gravity.initialLocalPosition, initialLocalRotation, and initialLocalScale) on initialization. This ensures calculations are always bound back to baseline spatial matrices, preventing compounding precision drift errors caused by delta float updates.Vector3.Dot operation against the transform's forward vector to track linear distance traveled, combined with a Mathf.DeltaAngle calculation to determine angular turning offsets. This merges track vectors into an accurate, non-slip rolling sequence.elevationPivot reference but uses variable launch speeds, the script switches calculations to map the element's rotation to a flat 360-degree sweep scaled by the active power factor calculation profile (t * 360f). This handles crank-handle rotations accurately on fixed-chassis artillery like trebuchets or mortars where winding power scales distance.maxAudioSpeed, while pitch curves bend dynamically (from 0.75× up to 1.25×) to mimic weight changes before dampening to full silence when stationary.AudioSource components for translation wheels and targeting gear loops. By pulling continuous tracking sound updates completely out of the core weapon logic, this architecture guarantees that ongoing manual adjustments never prematurely clip or clobber discrete gameplay audio states like firing explosions or reloading clips.25f (such as when a weapon system fires a ResetWeapon() execution layout), calculations temporarily suspend to freeze the wheels and mute audio, eliminating instantaneous hyper-spin visual glitches or auditory bursts.Destroyed state, turning off looping audio immediately so separate debris fragment rigidbodies can fall and shatter naturally.Because the mechanical driver relies on a single generic script, you can easily replicate distinct ancient weapon physics setups natively in the Inspector without creating unique C# dependencies.
DPT_SiegeWeapon script component.ContinuousRotation, Local Axis to 1, 0, 0 (Local Right), and Multiplier to 5. This spins the wheel rapidly to match subtle muzzle tracking adjustments.MappedTranslation, Local Axis to 0, 1, 0 (Local Up), and Multiplier to 0.25. This causes the block to extend and slide upward exactly as the cannon barrel depresses downward into lower pitch angles.MappedScale, Local Axis to 0, 0, 1 (Local Forward), and Multiplier to 0.3. This stretches the visual coil meshes along their axis as target range increases, indicating rope torsion.ContinuousRotation, Local Axis to -1, 0, 0 (Inverted Local Left), and Multiplier to 6. This handles spinning opposite mechanical fixtures smoothly.Arm -> Sling_Pivot (Empty) -> Sling_Ropes (Animated Visuals).Sling_Pivot to the Target Transform, and Sling_Ropes to the Animated Child. Set Recovery Duration to 0.25.onFireEvent to PausePendulumByLabel, passing your sling's string label.onFireCompleteEvent (or onIdle/onReload) to ResumePendulumByLabel, passing the same label.0 seconds.0,0,0. The script will handle the downward gravity on the parent.
0 seconds. The physics script must handle the visual smoothing, not the Animator.
Multiplier property (e.g., change 5 to -5) or flip the alignment values of your Local Axis property input fields inside the Inspector window.
Vector3.right axis. Ensure your individual wheel meshes are modeled with their pivot forwards facing the exact same direction as the main vehicle chassis parent structure.
Track Width input field. If this value is too narrow relative to your physical asset layout, turn deltas overwrite linear vectors too aggressively, inducing visual slip.
minLaunchSpeed and maxLaunchSpeed possess identical metrics on a weapon without a physical elevation pivot, your interpolation fallback ratio cannot resolve and returns a flat value of zero.
For all technical assistance, bug reports, asset configuration help, and general support, please reach out via email using the Contact Form. This is the primary and most reliable way to get help with any problems you encounter with the packages.
You can also use this form to inquire about custom freelance technical art services. If your project requires external 3D models to be integrated into the DPT ecosystem—including bespoke vertex-data packing, procedural wood grain mapping, GPU wind systems, or game-ready LOD budgeting—get in touch to discuss your specific needs and availability.