Compare Collision Channel

Greetings!

I have a rocket ship that I want to explode if it overlap a staticmesh and so far, that is working just fine.

The problem is: It will also explode if I overlap a Pickup Item, something I don’t want to happen.

How to give different outcomes when I overlap something?

Thank you for your time!

Could you post a screenshot of your current blueprint?

Well if it helps, there you go!

The first image is from the Pickup Item. When I overlap, it adds fuel to the rocket.

The second image is in my Rocket blueprint (player). Pretty much empty but so far I though to add functionality when the Capsule of my pawn would overlap with any walls, triggering an explosion.

Rather than having an overlap on the pawn that kills the rocket on overlap, you could make it so that the obstacles/enemies apply damage to the rocket when it overlaps with their collision.

What you need to do here is cast the “OtherActor” to something in order to differentiate it from pickups. Preferably your obstacles are instances (or childs) of a shared class “BP_Obstacle” for example.

Then draw a cast to BP_Obstacle from the “OtherActor” pin and only if the cast succeeds, you explode the rocket.
(Or you do this in the BP_Obstacle Overlap event like KalemRose suggested)

If they don’t share a class you could try turning this around, for example if you overlap things that are not pickups (eg. cast to pickup fails) you consider them an obstacle.

Lastly you could also use custom collision channels.

Hope I could help you with this!

Cheers :smiley:

That is a great suggestion! I think it will do just fine.
Thank you both for your help! :slight_smile: