#Unreal Objects owned by Actors in a
1 messages ยท Page 1 of 1 (latest)
Hey Dan! I'm continuing this because I made some tests and I don't manage to make it work like you suggested.
As you suggested, I created an object reference to my component (PersistentAmbComponent in this case) in a GameInstance class. However, on level change, I still have OnComponentDestroyed that gets called. What am I missing/not seeing?
(and if you feel this discussion is best had somewhere else, don't hesitate to tell me!) ๐ Thanks a lot for your help โค๏ธ
What is the super class of UPersistentAmbientComponent? is it a regular uobject?
Are those Blueprints in an Actor class?
BTW looking at the code for audio component persistance it seems you can just create a persistent audio component -
though it's still a USceneComponent so will probably get garbage collected if it's not a reference somewhere (you can also try AttachToRoot() to make it not garbage collectable until you release it, probably)
UActorComponent
Yes!
Indeed, that's what I'm trying to understand and replicate to other components ๐
I think a UActorComponent will be owned by its actor, which will always belong to a world and can't persist between levels.
But UAudioComponent is also a UActorComponent
Even though now that I look at it USceneComponent is derived from UActorComponent so UAudioComponent is also an actor component. but still, might be worth trying for a UObject