Hey there y’all, so I’ve got a pretty straightforward circular spline attached to my pawn subclass with code that should make it loop at a set rate, but when I play in the editor, the pawn accelerates to ludicrous speeds. Any ideas as to why?
(SplineSpeed is set to 0.001f in the header and never changed)
// move our gunship along the currently set spline
if (SplineComponent->GetSplineLength() != 0.0f) {
SplinePos += SplineSpeed;
if (SplinePos >= 1.0f) {
SplinePos = 0.0f;
}
// location
VisualMesh->SetRelativeLocation(SplineComponent->GetLocationAtDistanceAlongSpline(SplineComponent->GetSplineLength() * SplinePos, ESplineCoordinateSpace::World));
// rotation
VisualMesh->SetWorldRotation(SplineComponent->GetRotationAtDistanceAlongSpline(SplineComponent->GetSplineLength() * SplinePos, ESplineCoordinateSpace::World));
}