In this lecture Stephen uses AddActorLocalOffset to change the movement vector of the Tank each frame, but I’ve been trying to implement the same behaviour with the new Enhanced Input plugin and, in the video I used as reference, they use AddMovementInput in it’s place. So to me it seems like they do very similar things. Could anyone tell me when I should use each one or what’s the difference between them?
Also, the Tank actually moves with AddActorLocalOffset but it doesn’t with AddMovementInput, even though the inputs are the same. Maybe I did something wrong with how I use it? This is the current snippet of code in my project. The commented part is what I tried to do with AddMovementInput that sadly does not seem to work.
void ATank::EnhancedMove(const FInputActionValue &Value)
{
if (Value.GetMagnitude() != 0.0f)
{
// From Stephen's lecture, it works:
FVector DeltaLocation = FVector::ZeroVector;
DeltaLocation.X = Value[1];
DeltaLocation.Y = Value[0];
AddActorLocalOffset(DeltaLocation);
/* From another video, it doesn't work:
AddMovementInput(GetActorForwardVector(), Value[1]);
AddMovementInput(GetActorRightVector(), Value[0]);
*/
}
}