#Interacting with components instead of actors

1 messages · Page 1 of 1 (latest)

patent breach
#

So you would start your line trace like so.

#

I made three classes. StaticMeshComponent child, Interface, and an Actor child.

#

Interact function in the interface of course.

#

I put the interface in the static mesh component with a delegate

#

Now I put that static mesh on an actor

#

When I click on it I can see my Delegate in the list here at the bottom of Details.

#

So say I put two meshes on the actor and name them like yours.

#

I can just implement that delegate call in the graph with that + button.

#

This lets you generically interact with the component, and do things specifically in the mesh class, but also allows the actor itself to handle each mesh differently too.

#

Also. If you want the actor to have an interact when you do NOT hit one of these meshes but some generic mesh in the actor, you can also do this in your trace.

fringe laurel
#

oh ok tysm! that actually makes a bunch more sense now

#

how would i make each component have a visual appearance on the actor? This is how i have it setup right now, its just a main box and then the two buttons on the left and right which are the components im interacting with

fringe laurel
patent breach
#

It's whatever actor you need it to be.

#

For the component you'll likely want either a StaticMesh, SkeletalMesh, or Collision..something.

#

Scene component has no collision, so it cannot be traced.

fringe laurel
#

oh ok, so i'd use an actor component?

#

and then that's what i'd add to the main actor after?

#

also do i need a new actor componet for each button i want to add?

fringe laurel
fringe laurel
#

@patent breach one more quick question about it, i had this level actor and it had a box collision as the component used for interaction so by default it was invisible and just used for detecting the interaction, how can i make the new component work as a replacement for the box collision i had on previously

#

would it be just as simple as making the static mesh component hidden in game tab checked? Or is there a better way to go about it