How can I get the local velocity?

Hey just a small Update! I got it to work now. I used Unrotate Vector. I found this method after scrolling through the comments somewhere. This is what my code looks like now and it seems to do what I want.

  1. FVector V = GetVelocity();
  2. FRotator R = GetActorRotation();
  3. V = R.UnrotateVector(V);
  4. float XVel = V.X;
  5. FVector PlaneUp = GetActorUpVector();
  6. PlaneMesh->AddForce((PlaneUp)*(XVel));

I don’t know if there is a better way of doing it but this seems to work for now :). Again thank’s for your help!

3 Likes