Why can I not access this void?

Why am I not allowed to connect my player controller to my customization void called DisplayMeshComponent01()?

Its so simple. I just want to call teh ShowChosenMesh(int32 Choice) from within Unreal and then make that call the functions on my WorldCustomization class.

The description of errors in MVS is just incredible cryptic. I am just pulling my hair here my friends, I am overseeing something super simple I just know it.

MeshComponent01 is a property on an instance of AWorldCustomization. You need to get a reference to an instance of the actor first like

AWorldCustomization* Foo = ...
Foo->MeshComponent01->SetVisibility(false)

This is just making me more and more sad, how do I make an instance of this so it makes sense? I really cannot look at this non standard syntax or use &^to create a pointer to member anymore. Any help would just be so very much appreciate. Its been hours of this ■■■■. it started out so well with just interface working, small tweaks here and there, the interaction went well babababdada, then I got to this. BAM 6 hours of pure nonsens.

You write " =…" what does that mean? How do I make an.instamce of an actor? It’s not a subject or anything like that.

You can spawn one using GetWorld()->SpawnActor(), or you can add one to the level and then get a reference to it using UGameplayStatics::GetAllActorsOfClass or a TActorIterator

Ok so AWorldCustomization is an Actor class you’ve defined. You need to Spawn an instance of this actor in your world. Based on the name I’d imagine you want to add one to the level. Now you can add some code to get a reference to it in your player controller on BeginPlay:

// make a property to keep a reference to the customization
// In your player controller .h
UPROPERTY()
class AWorldCustomization* MyCustomization;


// in player controller begin play
MyCustomization = Cast<AWorldCustomization>(UGameplayStatics::GetActorOfClass(GetWorld(), AWorldCustomization::StaticClass()));


// Now you can do
MyCustomization->MeshComponent01->SetVisibility (false);

Hope this is clearer. (Might be syntax errors I wrote it on my phone)

Just emphasising I still dknt understand what to do here

I really appreciate this! It actually works! Haha, I love that you wrote it on your phone!

I have one final question regarding this issue Game Mechanic I am writing.

  1. I go to the Mechanic “Interaction” (WorldCustomization_BP)
  2. It shows me 3 options.
  3. I pick on it displays the static mesh I have chosen
  4. GREAT!
  5. Now I duplicate the instance (WorldCustomization_BP2)
  6. I interact with it, get the UI, make a choise,
  7. BUT it now changes the visibility on WorldCustomization_BP not on WorldCustomization_BP2

Glad it worked!

I think the problem now is that “GetActorOfClass” always returns the first AWorldCustomization it finds in the world.

What does your Interact method look like? Could you pass a reference to the instance of AWorldCustomization that you’re currently interacting with?

I havent forgotten this issue, and I am still trying to fix it. Just needed to approach this mechanic from a different angle for a few days.

I think you are right that I somehow need to make a reference to the blueprint instance, not sure how though! Any idea?

What happens when you click one of those buttons? What events get called?