언리얼
unreal) DrawDebugSphere
HJH0825
2024. 11. 19. 00:47
매개변수
- Center: The center location of the sphere in the game world.
- Radius: The radius of the sphere.
- Segments: The number of segments used to approximate the sphere’s surface.
- Color: The color of the sphere.
- PersistentLines: Whether the sphere’s lines should persist between frames.
- LifeTime: The amount of time the sphere should remain visible, in seconds.
- DepthPriority: The priority of the sphere’s depth in the rendering pipeline.
- Thickness: The thickness of the lines used to draw the sphere.
DrawDebugSphere(GetWorld(), GetActorLocation() + FVector(0, 0, 200),
100.f,12, FColor::Red, true,30.f);
GetHitResultUnderCursor
Trace Hit
void ATank::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if(PlayerControllerRef)
{
FHitResult HitResult;
PlayerControllerRef->GetHitResultUnderCursor(ECC_Visibility, false, HitResult);
DrawDebugSphere(GetWorld(), HitResult.ImpactPoint,
25.f,12, FColor::Red, false,-1.f);
}
}
참고
https://agrawalsuneet.github.io/blogs/drawdebugsphere-in-unreal/