How to give actor components velocity?

Sure! Here’s the direct answer:

To give actor components velocity (for example, in Unreal Engine), you typically need to apply movement through a physics simulation. Actor components like a StaticMeshComponent or PrimitiveComponent have built-in functions to set velocity if physics is enabled.

Here’s how you can do it:

Step-by-Step:

  1. Make sure physics simulation is enabled on the component:

    YourComponent->SetSimulatePhysics(true);
    
  2. Set the velocity directly:

    YourComponent->SetPhysicsLinearVelocity(FVector(1000, 0, 0));
    

    (This example gives it velocity in the X direction.)

Important:

  • If Simulate Physics is off, setting velocity won’t do anything.
  • You can also add forces or impulses for more natural movement:
    YourComponent->AddImpulse(FVector(1000, 0, 0));
    

Summary:
:backhand_index_pointing_right: Enable physics simulation ➔ then use SetPhysicsLinearVelocity or AddImpulse to give it velocity.

Would you like a quick example in Blueprints too? :video_game::rocket: