The idea here is that a player selects a spot on the map, click on “buy”, select an object to place there then “poof” this prefab spawns there with the mesh specified as level 0 visible. From there they can click on upgrade and poof, the next mesh is visible.
So the sort answer is that the blueprint will be spawned in the scene and then the ActorComponent class needs to function on it from there.
Think of any tower defense game to give you an idea of what I’m trying to do. You spawn a turret here, then another one there. Soon you have 50 instances of the blueprint spawned and need to upgrade each one individually.
I noticed someone recommending you add tags and search for scene objects by tag but, like I just said, I need to upgrade them individually so tags are not gonna be of any help since that will find the blueprint and I don’t need that. I will select the blueprint by clicking on it in the scene. Then I just need to tell it “Hey, upgrade, please” from the popup menu I will spawn at it’s location.
That is the goal here. It sounds like it should be super simple but, yeah, I am stuck on this part of the puzzle.
Thanks for the assist. Greatly appreciate it.
P.s. So I originally had it as an array of Static Mesh and that let me search for meshes in the project. I then changed it to Static Mesh Component and that gave me some weird options. It looked like it was letting me choose classes rather than components. I selected Static Mesh and inside that it then gave me plenty of sections including one where I can select a static mesh from the project again.
So I changed back to Static Mesh instead ![]()
Trying both ways…
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Upgradable Object")
TArray<TSoftObjectPtr<UStaticMesh>> Meshes;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = "Upgradable Object")
TArray<UStaticMeshComponent*> MeshComponents;
