DrawCircle (SceneManagement.h) can't get it to work

I am trying to build some solar system rings around a star and thought to use the DrawCirlce() function. For the life of me I can’t get it to work. I put in all the correct params but the compiler keeps telling me that out of the 2 overloaded types it could not convert all the argument types… Any ideas why this failing… I am finding it very hard to find anyone with an example either online…

I have pasted the entire method below but really the line in question is: DrawCircle(GetWorld(), Base, RandomAngleX, RandomAngleY, RingColor, CurrentOrbitRingRadius, NumSides, true, Lifetime, DepthBias, LineThickness);

Would be grateful for any help, thank you UE community in advance…

void ASolarSystem::DrawSolarSystemRings()
{

	//Get everything needed to create a DrawCircle
	FVector const Base = GetActorLocation();
	FVector MinRandomAngleX = FVector(0.0,0.0,0.0);
	FVector MaxRandomAngleX = FVector(1.0,0.0,0.0);
	FVector MinRandomAngleY = FVector(0.0,0.0,0.0);
	FVector MaxRandomAngleY = FVector(0.0,1.0,0.0);


        //Get random AngleX, AngleY using seed
	FVector RandomAngleX = SolarSystemFunctionLib::GetRandomFVectorWithSeed(MinRandomAngleX, MaxRandomAngleX, GameInstance->ST_GetRandomStream());
	FVector RandomAngleY = SolarSystemFunctionLib::GetRandomFVectorWithSeed(MinRandomAngleY, MaxRandomAngleY, GameInstance->ST_GetRandomStream());
	


	FLinearColor const RingColor = FLinearColor::MakeFromHSV8(158, 67, 92);
	int32 NumSides = 32;
	uint8 DepthPriority = 0;
	float LineThickness = 1.0f;
	uint8 DepthBias = 0;
	float Lifetime = -1.0f;


	//Decide on how many celestial bodies will be around this planet
	int32 RandomNumRingsWithSeed = SolarSystemFunctionLib::GetRandomIntWithSeed(MinOrbitRings, MaxOrbitRings, GameInstance->ST_GetRandomStream());


	float PreviousRingRadius = StarSize + 1000.0f;
	float CurrentOrbitRingRadius;

	//Loop through each ring, create a random radius for each ring (previous ring + 1000 * random multiplier)
	for (int32 i = 0; i < RandomNumRingsWithSeed; i++)
	{
		CurrentOrbitRingRadius = PreviousRingRadius + 1000.f * SolarSystemFunctionLib::GetRandomFloatWithSeed(1.2f,1.5f, 
			GameInstance->ST_GetRandomStream());

		PreviousRingRadius = CurrentOrbitRingRadius;

		DrawCircle(GetWorld(), Base, RandomAngleX, RandomAngleY, RingColor, CurrentOrbitRingRadius, NumSides, true, Lifetime, DepthBias, LineThickness); 
		
	}
}

Change FLinearColor to FColor.
You can convert a FLinearColor to FColor by calling the .ToFColor(bool) function on it.

I’m not sure why it doesn’t work with FLinearColor I tried importing Math/Color.h but still got the same issue as you. It doesn’t complain about FColor though.

Let me know if this helps.

1 Like

Think that’s it. Thank you. The DrawCircle() function has two overloads one using FLinearColor and the other FColor… compiler accepted the FColor… ran into another seperate issue now regarding compiler linking… so will safely assume you caught the error for DrawCircle()…

Thanks for the input. Greatly appreciated…

p.s - Update - linking error resolved… the DrawCircle using FColor worked perfectly. Thankyou. Resolved.

1 Like