I have an APawn with a component that I use to move it, its constructor is something like:
SMPaddle = CreateDefaultSubobject(TEXT(“SMPaddle”));
SMPaddle->AttachToComponent(RootComponent, AttachmentTransformRules::KeepWorldTransform);
And a method that I call to assign it different velocities:
void APaddle::SetDesiredVelocity(const FVector& desiredVelocity)
{
SMPaddle->SetPhysicsLinearVelocity(desiredVelocity);
}
Everything works fine until I assign a zero-length vector as the velocity in one of the calls. After that, when I assign velocities with lengths greater than zero, the Pawn doesn’t move anymore. However, if something collides with this Pawn in the game, it starts moving normally again. I searched the documentation but couldn’t find anything about this.
I’m doing something wrong or is it a normal behavior?