#Section 5 Challenge: Creating a Debug Cone

4 messages · Page 1 of 1 (latest)

brisk dune
#

I am trying to create a Debug Cone but the code isn't working for some reason. I'm getting a line instead of a cone. I did the same thing in blueprints and it worked fine so I'm not sure what the issue is here.

Green line in the image is what the cone turns into.

#
#define DRAW_SPHEREANDCONE(Location) if (GetWorld()) \
{ \
    DrawDebugSphere(GetWorld(), Location, 30.f, 64, FColor::Black, true); \
    DrawDebugCone(GetWorld(), Location, FVector(-1.f, 0.f, 0.f), 100.f, 45.f, 45.f, 12, FColor::Emerald, true, -1.f, 0, 1.f); \
}
eternal citrus
#

Hey if you never solved this, I think it's probably because the angle is given in radians in the C++ version. Just multiply the intended degree measurement by pi/180 (roughly 0.0175) to convert!

pallid olive
#

Or just use this FMath::DegreesToRadians(float DegVal)