Debug Camera Rotated 90 degrees

I saw someone else had this with ureal 4.26 and I seem to be having this issue with 5.5

When I run the code in Gun.cpp

DrawDebugCamera(GetWorld(), GetActorLocation(), GetActorRotation(), 90, 2, FColor::Red, true);

The debug camera shows up rotated 90 degrees to the left

Okay so I found out why I think this is happending per another discussion of this issue the mesh is rotated. When I looked at my own it was rotated -90 degrees

So in the c++ code I added a little snippet which may be a bit wasteful on the memory front but I felt it was more readable this way.

FRotator DeltaRotation = FRotator(0.f, 90.f, 0.f);
FRotator OffsetRotation = GetActorRotation() + DeltaRotation;
DrawDebugCamera(GetWorld(), GetActorLocation(), OffsetRotation, 90, 2, FColor::Red, true);

Also here is the previous conversation that tipped me off as to what was happening.

1 Like