How to attach a camera component to a actor at runtime?

Hi guys,

I’d like to know how to attach a camera component to a actor dynamically. I know I can attach one using PCIP in the constructor, but can I attach a camera component at runtime outside the constructor? I think I need to register it after I attach it? Also, How to set the new attached camera as the main camera?

P.S. I think I don’t need to load a camera asset in this situation, but if I want to attach a mesh or something, how to load the asset at runtime?

Thank you!

Try this: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums