change actor when colliding with my character (resolved)

Hello, I would like to know if it is possible to change the actor when colliding with my character

cap2

it doesn’t work here

cap2

here are the actors

cap3

the brick box blueprints

cap5

and mario blueprints

The easiest way to do this is to make these the same blueprint

and when mario collides, just change the material on the cube.

1 Like

and how I would do it. Could you show me graphically?

here I added

They have two different shapes

1 Like

Ok, then you can do it with visibility

Two different meshes in my BP ( and the collision volume )

Construction script

image

Overlap code

overlap

1 Like

Hello, thanks for answering. I tried but it didn’t work. I don’t know what I did wrong, I’ll show you

Just before starting the game you can see the two meshes, that’s fine.

and when I start the game it is fine that the brick mesh is visible but when it collides it does not change to the other mesh

cap1

Ok, it looks good. Try putting a print string here, to see what overlaps

1 Like

add but it has no effect

cap1

cap2

Not sure if you remember, but in the private thread a while back:

Are you sure you can / want use an overlap for this? If the collision is not specifically set and configured to handle overlapping, this will never work.

Any reason you’re not using onHit?

1 Like

now I have it like this

Print this

image

So why are you even using an overlap then…

image

Use the same hit to trigger the changes you want. Something like:

Hit the collider, change mesh, play the animation.

nothing :face_exhaling:

cap4

I also did this but there is no effect either

You’re setting the mesh to nothing…

image

Take the static mesh component that is already there and change its mesh. You do not need 2 components for this.


From your project:

I think that’s what you need, right? And you can use a DoOnce node if you want this to happen only once.

1 Like

Then it’s not overlapping :melting_face:

No, I had already solved that, what I need is another actor, where I have a brick box, and when it collides with my actor, the brick box transforms into a deactivated yellow box (they are two different models)

That’s what the above does. It switches meshes about. Put whatever new mesh you want the component to show. Or spawn a new actor and destroy the old one - but that sounds like a poor solution here. Is it really necessary?


Other than that, not sure what you mean / want.

I think the problem is here, when I activate this, it does not start the game but it is missing, this object does not appear

I did it!!! What I did was a mix of the two tutorials they sent me, I combined two things. thank you!!!

1 Like