Download

Sharing Blueprint - referencing actors/BPs common practices? (eg. for Marketplace)

Hello,

I’m looking through my projects and snippets and thought, that could try sharing some on the Marketplace, so I’m working on putting by Blueprints in separate project(s) ready to share.
Since I learned everything by myself - some of it is a mess :wink: and I have lots of cleaning to do.

Now, the problem: I want to share a Blueprint, that works with actor(s)'s or player’s components, but I have Cast To implemented, and I don’t know how exactly the final user will use it.

For the sake of this post let’s say my plugin influences the player’s camera when he triggers something (cause it will be easiest to explain).

So in my projects I can just have functions/events that on trigger will Cast To MyPlayer BP, then get the Camera component and done - all the logic comes after.
But once I share my BP - that hardcoded cast to MyPlayer BP wont work, right? The other creator using my BP will have different class for player (eg, MyLittlePony) or even the same name, but different implementation, thus this will never work. Even if I add the parameter to my BP - Actor or whatever, that creator will just reference his player - at some stage I need to cast to something and check for the camera. Or not?

So what I did at the moment is creating an Interface I_Player with a function Get Camera that has only one output pin (Camera), and in my BP I’m checking, if the triggering actor has implemented that interface, then just calling Get Camera (inside my BP to be shared) and voila!

Question1: Is that the right solution?
Question 2: What is the common practice to do that?

These will be for sale on the Marketplace or free like projects in Community Tools?
If its the MP, you have to get them vetted by Epic anyway, so email the MP team!
If its the latter, you can always just browse projects in the CT section to get ideas…

The goal is Marketplace, if possible :wink:

I wanted to ask here before I bother them with noob questions :smiley:

You’re better off contacting them early on, otherwise you can lose endless time in never ending rejections. Do some reading in that section… As regards Casts vs Interfaces? Didn’t read the above closely, but its usually better to always use Interfaces if possible! :wink:

Tx for the reply.

Even if I get rejected - at least I clean up my mess and make it reusable in other projects!