#Right it's me again with a long ass
1 messages · Page 1 of 1 (latest)
one sec
it's attached to static mesh - Interactable_Mesh
i can share more of my code to visualise it better.
top screen - most important part right in the middle when I'm calling the function and passing the values into it
and on bottom screen, the upper half behind the breakpoint
this is definitely wrong, because it's detaching the static mesh of the furniture rather than the object attached to it
also getting that mesh as a reference is not right because the static mesh itself (if i'm not wrong) does not hold any info about actors attached to its sockets
I think theres a way to get actors attached to its sockets one sec
There's a "get children components"
yeah that doesn't do anything
I mean in this case, I tried
unless I should be using Get ComponentS
there's just one socket in that mesh
I'd try the plural one just as a sanity check
so i'd guess it'd have index of 0
yeah
brb
returns none
I think I should just pass the entire actor to that function
with self reference
There's supposedly a C++ way to get "AttachChildren" as seen here:
for (auto SceneComp : GetMesh()->AttachChildren)
Just not sure what the blueprint equivalent is
Yes, you can. //Loop through all the sockets of the mesh for (auto SceneComp : GetMesh()->AttachChildren) { GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, SceneComp->AttachSocketName.ToString()); //We want to get all children of a specific socket name if (SceneComp->AttachSocketName == this->HolsterGr...
it's a bit tricky yeah
oh man hang on
I think I messed up
and it's going to be a nightmare to fix
I need to give some background here
so when I make a pizza it's done via code in the pizza making widget, not the BP_PrepStation
and I just noticed that I'm not attaching the object to a socket
I would need to somehow move it out of the widget into a BP_PizzaPrep..
mmm. yeah would generally advise against having a bunch of game logic in your widgets
yeah. lesson learned.. it was the first time i worked with widgets in a more complex way than usual
it's scary to touch it now
yeah, projects often get to that state when you're figuring out how to work with Unreal. It's very normal!
As a quick sanity check, I did a really simple test in the third person template project and confirmed that "get children components" is working as expected
it does return components when spawning actors and attaching them to it.
yeah it's the widget issue..
can I ask another question though?
I figured I may add an interface.. and I'm not very good at using them.
I want to send info about 2 variables via the interface to the BP_PrepStation
and thing that I don't understand is
target node
I had the same issue with casting, I know it's not a complex thing but my brain just can't grasp it properly.
so I'm trying to push myself and rather than casting use interfaces whenever I can to train my brain
so target would be the BP_PizzaPrep?
Is BPI Make Pizza an actual Blueprint Interface?
yes
just created it
with a MakePizza function
as I try to move the stuff that I pasted earlier into bp_pizzaPrep
Do you have separate Blueprint that specifies that it implements the BPI Make Pizza interface?
Yeah so "target" on the node is specifying which instance of the BPI Make Pizza interface in the world will be notified to call "Make Pizza"
Since you can theoretically have multiple instances of classes that implement BPI Make Pizza spawned at any point in time.
so I need that one specific actor that I'm interacting with to be referenced, and not just a variable of type BP_PizzaPrep
I mean I need to set it to that actor.. somehow
I'm sorry. I'm still quite new to unreal and it's breaking my brain at times.
referencing is the most difficult stuff ever
I know what I need to do, but I don't know how
and I don't really want to do the "get all actors of type" workaround
I need to somehow pass the actor into that widget
when I do this can I get that "self" reference inside the widget?
Oh wait.
i'm actually setting it there
so my prep station ref variable would be populated properly
Im heading out good luck friend