Back to search
PatternGold tierInteraction

Mouse click to world: detect clicked actor or ground position

Updated 3mo ago
UE 5.3UE 5.4UE 5.5UE 5.6UE 5.7#mouse#click#world#trace#pick#select#ground

Reference

On Left Mouse Button pressed → GetHitResultUnderCursorByChannel(TraceChannel=Visibility) → Branch(ReturnValue=true) → BreakHitResult → Check HitActor: IsValid(HitActor) → Branch → True: interact with HitActor. Check ground: use ImpactPoint as the world position clicked.

GetHitResultUnderCursorByChannel is on PlayerController. Inputs: 'TraceChannel' (ETraceTypeQuery) and 'bTraceComplex' (bool). Output: 'HitResult' (struct) and 'ReturnValue' (bool). Use BreakHitResult to get ImpactPoint, HitActor, etc.