RealDocs

AActor::SetRayTracingGroupId

function Engine Blueprint Since 5.0
#include "GameFramework/Actor.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Assigns a ray tracing group ID to this actor. Components that have no explicit group ID set will inherit the actor's ID, allowing selective inclusion/exclusion of groups from ray tracing passes.

Caveats & Gotchas

  • Only has an effect when Hardware Ray Tracing (HRT) is enabled in the project. On platforms or configs without HRT, this call is a no-op.
  • The ID is actor-level; individual components can override it with their own group ID. Setting the actor ID does not overwrite component-level overrides.

Signature

ENGINE_API void SetRayTracingGroupId(int32 InRaytracingGroupId);

Parameters

Name Type Description Default
InRaytracingGroupId int32 The group ID to assign. Components with an invalid (default) ID will inherit this value.

Return Type

void

Example

Assign a shared group ID to a set of actors C++
// Group all debris actors so they can be excluded from expensive RT reflections
const int32 DebrisGroupId = 42;
for (AActor* Debris : DebrisActors)
{
    Debris->SetRayTracingGroupId(DebrisGroupId);
}

Version History

Introduced in: 5.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.