I want to create a new actor class in c++ and I want to make a reference to a shape that someone will create in unreal editor.
I want to implement a overlap event that control the material of a shape but I don’t want to create the shape or the component that trigger the event, I want those component to be created in unreal editor.
Is that possible? is that the way unreal usually is programmed?
In fact, I want to attach a event to a collision box in a blueprint, but the tutorials I had seem create the collision box in c++ and attach the event to it, is there a way to get the collision box I created in the unreal editor and attach the event to it?
Yes everything you can make in C++ cane be made in Blueprints.
So about your logic, I think you should create a blueprint that can hold your shape.
Then in your character blueprint, create a variable to hold that blueprint you just made. And then when you create the shape (spawning the blueprint) you set that same blueprint to the variable in your character.
From there you can access everything from your shape by just dragging that variable from your character. By the way, make sure you make shape’s blueprint variables public.
About the collision box. I believe that you need to make first the collision box, then attach to the collision box your shape. The structure would be
[Root] Collision box
ShapeModel
The type of your blueprint of the shape. For example if you named your shape’s blueprint: “BP_Shape”, then “BP_Shape” is your type of variable.
Well just expose the variable to the blueprint with keywords such as “BlueprintReadWrite” / “BlueprintReadOnly”. You can find more information on them here.
No problem mate, the forum is to get help
Feel free to ask more, if you didn’t understand something.