UKismetMathLibrary::Sin
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns the sine of angle A in radians. Result is always in the range [-1, 1].
Caveats & Gotchas
- • Input must be in radians, not degrees — passing a degree value (e.g., 90) will return sin(90 rad) ≈ 0.894, not 1.0. Use DegSin if your angles are in degrees.
- • For game-logic wave effects that run every tick, consider precomputing with a lookup table or using FMath::Sin directly to avoid Blueprint overhead if called thousands of times per frame.
Signature
static UE_INL_API double Sin(double A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | double | The angle in radians. | — |
Return Type
double Example
Drive a floating bobbing effect C++
void AFloatingActor::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
double Time = GetWorld()->GetTimeSeconds();
double BobOffset = UKismetMathLibrary::Sin(Time * BobFrequency) * BobAmplitude;
SetActorLocation(BaseLocation + FVector(0, 0, BobOffset));
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?