#Right it's me again with a long ass

1 messages · Page 1 of 1 (latest)

covert axle
#

What component is the socket on? Is it a skeletal mesh component?

safe dawn
#

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

covert axle
#

I think theres a way to get actors attached to its sockets one sec

safe dawn
#

Get Attached Actors

#

maybe not

covert axle
#

There's a "get children components"

safe dawn
#

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

covert axle
#

I'd try the plural one just as a sanity check

safe dawn
#

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

covert axle
#

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

safe dawn
#

it's a bit tricky yeah

covert axle
#

That link does have a blueprint example actually

#

at the bottom

safe dawn
#

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..

covert axle
#

mmm. yeah would generally advise against having a bunch of game logic in your widgets

safe dawn
#

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

covert axle
#

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.

safe dawn
#

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?

covert axle
#

Is BPI Make Pizza an actual Blueprint Interface?

safe dawn
#

yes

#

just created it

#

with a MakePizza function

#

as I try to move the stuff that I pasted earlier into bp_pizzaPrep

covert axle
#

Do you have separate Blueprint that specifies that it implements the BPI Make Pizza interface?

safe dawn
#

yes, BP_PizzaPrep

#

I should have this logic in there in the first place..

covert axle
#

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.

safe dawn
#

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.

covert axle
#

Yep that sounds correct

#

No problem. These are difficult programming concepts

safe dawn
#

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

covert axle
#

Im heading out good luck friend