Set actor/mesh in struct

i cant set a mesh/actor var in a struct, either in the editor panel of the struct, or in a BP (rather do it in editor panel)

Hi bennetherwood,

Which version of the editor are you seeing this behavior in?

4.61, haven’t upgraded as it may cause issues due to the “preview” that scares me. I think in the struct editor itself the set actor property disappears on purpose, but in the BP I have a actor drop down box. none of my actor BP’s are showing up - just to clarify an actor Bp should show up for an actor in a struct right ?

Make the sctruct editable. Try placing this blueprint in your scene. Click on it and look at the options at the right side of the editor, below the outliner. Look for your actor variable inside your struct (that should be visible due to the editable option). Here you should be able to fill the actor with an actor that is already in your scene.

As far as i understood, you can’t set a reference variabel without spawning the blueprint object.

Correct me if i’m wrong @TJ Ballard

that isnt what i want to use the struct for thought, Im using the struct as a database for spawn-able items that can be created by the player, the struct is more of a database with items that has associated values (mesh, size, cost) and I cant use the method put forward by you (but thanks) is there another way to do this then ?

thanks

You made common novice mistake, blueprints are not objects, they are classes same as c++ classes, they wont exist until you spawn it from class. Open class viewer and search for your blueprint there, it will open your eyes

Object type (blue color) can only hold already instatiated object, outside of runtime you can only set object that are on the level. If you want hold class refrence (which can be your blueprint) in varable you need to pick class type (purple color) insted. Then you can use that varable to for example, spawn object of class (blueprint) that varable hold refrence of.

Watch my tutorial about basics of object and classes Unreal Engine 4 Tutorial: Basic knowlage about Classes and Objects - YouTube

ah thank you so much, however I have to set them in the BP itself, you cant just add a ref to a struct, so I will have to build a database in the Bp, but thank you so much man !

This should be pinned: blueprints are not objects, they are classes same as c++ classes, they wont exist until you spawn it from class