quinta-feira, 16 de março de 2017

BP Compendium 3: Interp To

Interp To


Set of functions used to change a value smoothly until it reaches the specified target value. Some examples: "FInterp To" for values of type "float", "VInterp To" for vectors and "RInterp To" for "rotators".

Input
  • Current:  Current value that will be modified.
  • Target: Target value to be pursued.
  • Delta Time: The time interval that has elapsed since the last execution.
  • Interp Speed: Interpolation speed.

Output
  • Return Value: New value closer to the target value. 

Example Usage: 

The image below has two variables. The "Real Health" variable contains the player's current health. The "Display Health" variable is used to display a health bar on the screen. When the player suffers damage, the value of "Real Health" is changed immediately, but the value of "Display Health" is modified using "FInterp To" so that the health bar smoothly decreases until "Display Health" is equal to "Real Health".

Click to enlarge

In another example, the "TurnRight" event commands a robot to turn 90 degrees to the right. This rotation is done smoothly using the "RInterp To".

Click to enlarge