Hi all!
How would it be possible to change the line thickness in Ray Tracing with just pressing one button again and again?
I imagine something like this:
- Gameplay starts, trace lines are hidden (this works).
- Press “zero” button (or any other), and trace lines are displayed with 1 unit of thickness.
- Press “zero” button again, and trace lines are displayed in a thicker version, with 2 units of thickness.
- Press “zero” button again, and trace lines are displayed in a thicker version, with 3 units of thickness.
- If I press the button again, trace lines are not displayed.
Here is my code snippet:
in header:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Linetrace")
bool DebugLineSwitch;
in cpp:
// If DebugLineSwitch is turned On, rays are deisplayed during simulation
int LineThickness = 0;
if ((DebugLineSwitch == true) && (LineThickness = 0))
{
DisplayRays(LoopNumber + 1, TraceStart, TraceEnd, RayColor, LineThickness = 1);
//DebugLine: //GEngine->AddOnScreenDebugMessage(-1, 1.f, FColor::Green, FString::Printf(TEXT("Great!")));
}
else if ((DebugLineSwitch == true) && (LineThickness = 1))
{
DisplayRays(LoopNumber + 1, TraceStart, TraceEnd, RayColor, LineThickness = 2);
}
else if ((DebugLineSwitch == true) && (LineThickness = 2))
{
DisplayRays(LoopNumber + 1, TraceStart, TraceEnd, RayColor, LineThickness = 3);
}
Any help is appreciated.