void ClearInterpolation()

book_4_sparkGenerated
code_blocksInput

Description

The ClearInterpolation method is used to immediately stop any ongoing interpolation of a GameTransform and set it to its final destination. This is particularly useful when you need to ensure that the transform reaches its target state without any delay or gradual transition.

If the object is owned by the local client, this method will also notify other clients to clear their interpolation when they receive the next network update, ensuring consistency across the network.

Usage

Call this method on a GameTransform instance when you need to bypass interpolation and directly set the transform to its intended final state. This is typically used in scenarios where immediate position or rotation changes are necessary, such as teleportation or instant movement.

Example

// Example of using ClearInterpolation
GameTransform transform = someGameObject.Transform;
transform.ClearInterpolation();

// This will immediately set the transform to its final state without interpolation.