I have a projectile class which derives from AActor. It can be set to either move along a spline or move at a set velocity. My problem is that it doesn’t seem to be following the spline correctly. I have plotted the spline using DrawDebugPoint and the curve is correct, which means all the points returned from GetWorldLocationAtTime(t) are legit.
In my tick code, I do this if we’re moving along the spline:
FVector location = SplineComponent->GetWorldLocationAtTime(mSplineTimer, false);
FRotator rot = SplineComponent->GetWorldRotationAtTime(mSplineTimer, false);
SetActorLocationAndRotation(location, rot, true, &sweep_result);
Also, when I initialize it to move along a spline, I call SetComponentTickEnabled(false) on my UProjectileMovementComponent, which I assume should prevent that from updating and itself moving my class on its own. Thus, if I set the location/rotation manually, it shouldn’t be overridden by the projectile movement component.
However, in game, the projectile moves totally not along the path and the rotation seems to wobble/be inaccurate. Is there something I’m overlooking when it comes to deciding to manually move this guy along a spline? I have an enemy that moves along a spline (done via blueprints, but it’s using the same spline Get* methods) which works just fine.