How DrawDebugBox() with rotation?

I have ATriggerBox class, no matter I do I can’t make TriggerBox visible and add another static mesh is no use cause it gets invisible too.

and when I use DrawDebugBox() I can get the vision of trigger box but DrawDebugBox() not follow rotation.

I will be thankful if someone can tell me how to give rotation to DrawDebugBox() or how to make TriggerBox visible?

There is a DrawDebugBox() command that takes a rotation as a FQuat.
If you don’t feel comfortable with Quaternions use a FRotator and do
rotator.Quaternion() on it.

e.g.:
DrawDebugBox(GetWorld(), GetActorLocation(), FVector(200.0f, 400.0f, 300.0f), rot.Quaternion(), FColor::Red);

for making the TriggerBox visible in game, set “Actor Hidden In Game” to false, it’s a setting under rendering.

275250-showactor.png

Thanks for your fast replay.
you are right its rotate now but now when it rotates draw box getting different scale.
code:

DrawDebugBox(GetWorld(), GetActorLocation(), GetComponentsBoundingBox().GetExtent(), GetActorQuat(), FColor::Red, false, 0.01, 0, 50);

for visibility, I tried sed visibility both in C++ and editor but nothing appear even when I add a cube from BP driven from Class, Cub getting invisible too in runtime.
code :

bHidden = false;
	SetActorHiddenInGame(false);

tried your code
works for me
had to change the 50 at the end to 1
otherwise the lines are way to thick

do you maybe have more than one scenecomponent on that actor?
GetComponentsBoundingBox() returns a combined bounding box
you could try just getting the box of the component you actually want to show

hmn showing the BoxTrigger in the game works perfectly fine for me

  • Place a BoxTrigger from modes in game
  • Set Actor Hidden In game to false in the details setting of that Box Trigger
  • BoxTrigger shows in game

red Cube debug draw, green cube Actor hidden = false