Chains (for Vehicles) - user-grinch/ModelExtras GitHub Wiki

๐Ÿš— Overview

Vehicle Chains allow animated movement of mechanical parts by playing a sequence of chain models in order. This is useful for tank tracks, conveyor belts, suspension systems, and other animated vehicle components. Each chain model in the sequence contributes to the overall animation, moving step-by-step in a forward or reverse direction.

โš™๏ธ How It Works

Each vehicle chain consists of multiple chain models, each representing a stage of the animation sequence. These models cycle through a set order, creating a fluid animation effect. The system supports both forward and reverse gears, ensuring smooth motion in both directions.

๐Ÿ›  Setup Instructions

1๏ธโƒฃ Create the Parent Node

  • Add a parent object named x_chain.
  • This acts as the container for all chain models involved in the animation.

2๏ธโƒฃ Add Chain Models

  • Place multiple chain models as children under x_chain.
  • Each model represents a different phase of the animation.
  • The number of chain models determines the smoothness of the animationโ€”the more models, the smoother the effect.

3๏ธโƒฃ Define the Animation Order

  • Forward Animation:
    • Models play in sequence from top to bottom (e.g., 1 โ†’ 2 โ†’ 3 โ†’ 4 โ†’ 5).
    • This creates the illusion of continuous motion.
  • Reverse Animation:
    • Models play in reverse order (e.g., 5 โ†’ 4 โ†’ 3 โ†’ 2 โ†’ 1).
    • This ensures smooth motion when the vehicle moves backward.

๐ŸŽฎ Example Setup

Suppose you have a moving tread animation for a tank or a conveyor belt. Your setup would look like this:

x_chain
 โ”œโ”€โ”€ ChainModel_1  (First stage of animation)
 โ”œโ”€โ”€ ChainModel_2  (Second stage of animation)
 โ”œโ”€โ”€ ChainModel_3  (Third stage of animation)
 โ”œโ”€โ”€ ChainModel_4  (Fourth stage of animation)
 โ”œโ”€โ”€ ChainModel_5  (Final stage before looping)

โœ… Expected Behavior:

  • When the vehicle moves forward, the sequence plays in order โ†’ 1 โ†’ 2 โ†’ 3 โ†’ 4 โ†’ 5
  • When the vehicle moves in reverse, the sequence plays backward โ†’ 5 โ†’ 4 โ†’ 3 โ†’ 2 โ†’ 1
  • The animation loops seamlessly, creating a realistic effect.

๐Ÿ” Why Use Vehicle Chains?

โœ” Smooth Movement: Helps simulate realistic mechanical motion.
โœ” Customizable: Works with any number of chain models for varying animation smoothness.
โœ” Bi-Directional: Supports both forward and reverse movement seamlessly.

By following this setup, you can bring dynamic movement to your vehicles, making them more visually engaging and realistic! ๐Ÿš€