Search code examples
c++unreal-engine5

How can I transform rotation to FVector in Unreal Engine 5?


How can I transform MainComponent->GetComponentRotation() to FVector?

Do I have to use AddForce() for child components?

I need to get its rotation vector. How do I get it correctly?


Solution

  • You should be able to use either

    MainComponent->GetComponentRotation().Vector();
    

    or

    MainComponent->GetComponentForwardVector();
    

    See documentation - GetComponentRotation() and GetComponentForwardVector() for more details.