Resources

Examples

FActorPrimitiveColorHandler::Get().RegisterPrimitiveColorHandler(
		NAME_MobilityColor,
		LOCTEXT("MobilityColor", "Mobility"),
		[](const UPrimitiveComponent* InPrimitiveComponent) -> FLinearColor {
			const float Variation = FMath::FRand() * 0.2 - 0.1;
			FLinearColor OutColor = FLinearColor::Gray;
			switch (InPrimitiveComponent->GetMobility())
			{
			case EComponentMobility::Stationary:
				OutColor = FLinearColor::Yellow;
				break;
			case EComponentMobility::Movable:
				OutColor = FLinearColor::Red;
				break;
			}
			return OutColor + FLinearColor(Variation, Variation, Variation);
		},
		[]() {},
		LOCTEXT(
			"MobilityColor_ToolTip",
			"Colorize primitives to show their mobility. Gray = Static, Yellow = Stationary, Red = Movable."));