Is using interfaces this way correct?

Hello everyone. I’ve just started using UE5 and I’m following this tutorial series Tutorial. I wanted to use an Interface in the code instead of casting, so I set it up as shown in the picture, but I’m not sure if this is the right way to do it. How would you have approached it?

Its ok however to ease down your pain (now or for the next time) you can just have one interface to do all of your things rather than adding them to other actors one by one by hand causing problem.

  • You can have one interface and multiple functions under it
  • You can have one interface and one multipurpose function under it

to solve your problems.

What I would do a CameraControl_BPI interface with a ControlCamera function in it.

Under it I define an blueprint enum as : CameraZoom, CameraPan, CameraReset whatever. and pass those enums with a float to functions.

Insider camera component I branch in the function as event like you do and branch through the enum incoming to do other functionality so it becomes something more managable.

Kolay gelsin

1 Like

Thanks, what you suggested seems quite logical.