GetOwner() for Collided BSP Primitive is null

Furinyx
Fri, 31 Mar 2017 20:44:25 +0000
World Creation

I am guessing this is potentially intended behaviour but on collision with BSP brushes, a primitive component exists but using GetOwner() on the primitive component returns null.

I understand that likely means BSP brushes do not derive from AActor (is there a reason they were implemented this way while still making use of normal components?) but are there any other use-cases where a PrimitiveComponent would never have an owner?

Currently, when querying components, I have been using GetOwner() without first caching a local reference to null-check as I was under the impression a component could only exist as a subobject of an owning Actor (as objects cannot exist in the scene without deriving from AActor, as far as I am aware).

I encountered this through raycasting - I was caching the hit component for use later, where I need access to the owning actor; this caused my Editor to crash, leading me to discover GetOwner() returns null on hit components when raycasts collide with BSP brushes in the scene.

3 posts - 1 participant