Spring Components
Spring Components, such as TransformSpringComponent, CamFovSpringComponent, AudioSourceSpringComponent, ShaderFloatSpringComponent, UiSliderSpringComponent and others are concrete implementations of the SpringComponent class.
Each of these components exposes the same or very similar public functions as the spring types, which we explained in the previous section. However, we recommend double-checking the available methods when using these components, as they often provide additional useful functions on top of the base spring functionality.
If you find that a particular method from the base spring is missing, you can access it through the public spring reference inside the SpringComponent.
Some examples of Spring Components and their functionalities include:
TransformSpringComponent: Applies spring animation to a GameObject's position, rotation, and scale.
CamFovSpringComponent: Animates the field of view of a camera component with a spring-like motion.
AudioSourceSpringComponent: Applies spring animation to an AudioSource's volume and pitch.
ShaderFloatSpringComponent: Animates float properties in shaders using spring behavior.
UiSliderSpringComponent: Adds spring-like animation to a UI slider's value.
AnchoredPositionSpringComponent: Applies spring animation to the anchored position of a UI element. Ideal alternative for Transform Spring Component position spring when using it on UI.
LightIntensitySpring: Animates the intensity of a light source using spring behavior.
RigidbodyPositionSpring: Applies spring animation to the position of a Rigidbody component.
These components provide a convenient way to integrate spring animations into various aspects of your Unity project, such as visual elements, audio, and shaders. By leveraging the power of Spring Components, you can effortlessly enhance the interactivity and responsiveness of your game, creating a more engaging and polished experience for your players.
Last updated