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! ๐