ATriggerVolume vs UAudioComponent

I was just curious why we have to do
GetOwner->FindComponentByClass
for AudioComponent but not PressurePlate?

We are assigning both nullptr by default and using the editor to assign what they are so I was a bit confused on the difference here. Thanks :slight_smile:

The pressure plate isn’t a component on the same actor. i.e.

key: name (type)

Door (AActor)
|- DoorSound (UAudioComponent)
|- OpenDoor (UOpenDoorComponent, we're coding this)

So from the UOpenDoorComponent instance that is on the actor you’re then getting the owning which would be “Door” in this diagraph and then looking down the list of components and getting the first audio component.

(also ATriggerVolume is not a component)

1 Like

Thank you so much for quick clear response. Definitely cleared up what I was confused about!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms