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.
Note: 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.
Available Spring Components
TransformSpringComponent- Applies spring animation to a GameObject's position, rotation, and scaleCamFovSpringComponent- Animates the field of view of a camera component with a spring-like motionAudioSourceSpringComponent- Applies spring animation to an AudioSource's volume and pitchShaderFloatSpringComponent- Animates float properties in shaders using spring behaviorUiSliderSpringComponent- Adds spring-like animation to a UI slider's valueAnchoredPositionSpringComponent- Applies spring animation to the anchored position of a UI element. Ideal alternative for Transform Spring Component position spring when using it on UILightIntensitySpring- Animates the intensity of a light source using spring behaviorRigidbodyPositionSpring- 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