Why can't I see my exposed variables?

I am curious as to why I can’t see my exposed variable when the actor is called

what is your variable type? you will only see variables exposed on spawn when the spawn node knows that the input class will only be the certain class that contains that variable.

It is a float

not the one i was looking for. let me rephrase that, what is the variable type of artifact?

you are talking about a variable you exposed on spawn yes? and not talking about variables made public which you wish to change in the level

This happens because your MagicArtifact variable in BP_PuzzleTool is of type Actor instead of MagicArtifact.

Because of inheritance the Magic Artifact is both an Actor and a “Magic Artifact” (or whatever the name of the actor-derived class is). Changing the type from “Actor” to “Magic Artifact” will expose the variable in the spawn actor node.

“Magic” is a struct. In “Magic” there is an actor class variable “Artifact”. I pulled in the struct to this Puzzle BP, and I am trying to get Artifact from Magic and get Artifacts exposed variables.

Ideally I am trying to create a puzzleBP where the Designer (outside of BP, using the editor) can spawn as many artifacts as he wants and set a positive or negative charge to each one individually. I was suggested by someone else to use Structs, but beyond that I am confused. I have never worked with Structs before.

Additionally, these artifacts need to spawn and be able to rotate around the PuzzleBP’s center (the puzzle is designed to work like an Atom). They can be placed anywhere that doesn’t really matter.

I can’t figure out how to instance artifacts in BP so the level designer can spawn and edit each attribute individually.

“Magic” is a struct. In “Magic” there is an actor class variable “Artifact”. I pulled in the struct to this Puzzle BP, and I am trying to get Artifact from Magic and get Artifacts exposed variables.

Ideally I am trying to create a puzzleBP where the Designer (outside of BP, using the editor) can spawn as many artifacts as he wants and set a positive or negative charge to each one individually. I was suggested by someone else to use Structs, but beyond that I am confused. I have never worked with Structs before.

Additionally, these artifacts need to spawn and be able to rotate around the PuzzleBP’s center (the puzzle is designed to work like an Atom). They can be placed anywhere that doesn’t really matter.

I can’t figure out how to instance artifacts in BP so the level designer can spawn and edit each attribute individually.

heres one method to accomplish what your looking to do in a similar manner to what youve already done. first create a struct with the attributes needed, in this case i used charge, ring, and rotation. the charge will be a -1 or 1 in this case but you could easily use a bool instead. the ring just denotes how far from the puzzle center the artifact will orbit. the rotation controls the orbits rate / direction, basically you can control how long the artifact takes to make one complete orbit.

next we need to create the artifact blueprint (i was in a rush and mispelled the name). to begin we need to create 3 variables which are the same as in the struct, then make them public (click the eye) and expose them on spawn (in details panel). next in the construction script add some script so your variables affect the actor, in my case i set rotation rate on the movement component, set the location of the mesh based on 100uu wide ring spacing, and i set the material color based on charge.

last comes the puzzle itself. here we will need two variables, one will be of the type of your struct and will be an array, the other will be of the type of your artifact and also be array. make the struct one public. now create a new custom event and in the details panel check the box call in editor which will allow you to run the event from the level editor via the details panel. next we use a for each loop on the struct array, each loop will spawn a artifact actor and set the variables therein based on the info provided in the array, then it will add the spawned actor to the other array so we have references if needed. when the loop completes we clear the struct array since we are just using it to specify the spawn parameters. the last thing i added was just a way to destroy all the artifacts in case you need to start from scratch.

the way the system i showed works is that in the details panel of the level editor you can create a array of struct values and for each index a actor will be spawned. so the script only cares about spawning. some things to note however i did not attach the artifacts to the puzzle which could lead to issues, but thats a simple thing to remedy. im sure this setup isnt 100% optimal either but its a place to start. anyway its a bit rushed and not detailed but im late for work so gotta go.

Hey thank you for all your advice. I made my life easier and just gave up on making an all-in-one tool, it is easier and more controllable to just drag and drop actors into place. That being said, I have another question, something easier.

So I have these artifacts that trail around a ring. Their pivot point is at the center of the ring and their rotation is a timeline from 0 to 360. I am running into the issue of- if I place an artifact and rotate its starting point to 60, when pushed it snaps back to 0 rotation and starts its timeline. Is there a way to set a starting point in the timeline for the initial push only?

For the exposed variables:

As far as the level designer being able to change them, if you mean by dragging objects to the level, the variables need to be “instance editable”. If you mean spawning them inside a blueprint, then you need to adjust the values when they are being spawned.

Structs in BP are a collection of variables pushed into a single variable.

Say you have “struct PhoneBookEntry”

It would probably look like this

struct PhoneBookEntry
{
FString Name;
float PhoneNumber;
}

A phone book entry would have both the name of the person answering the phone and their phone number, so an entry in a phone book has both.

Location, Transform etc. are structs in the engine. Try to figure out what their components are. Understanding structs will help a lot in the long run.