UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"water splashes on impact"
// Code to generate water splashes on impact for (int i = 0; i < VertexCount; i ) { // Get the distance of the vertex from the impact origin float Distance = (VertexArray[i] - ImpactOrigin).Size(); // Calculate the height of each vertex based on a sine wave equation float SinValue = FMath::Sin(Distance / SplashSpeed Time * SplashFrequency) * SplashAmplitude; VertexArray[i].Z = SinValue; }