Check if picked up item is the same as BP Item

Goodday!

How do I check if a picked up item is the same as a BP item?

1 Like

Hi Doeglas,

You can use the “Cast” node to try and cast to your BP - if it is the correct class you can branch off that node.

1 Like

What would I put in “Object”?

I had this before I posted.
image

1 Like

Just to clarify - are you wanting to know if it is the exact item, or just an item of that class? That code should work if testing for the exact time.

I want to see if the Key BP is the picked up item (Item Actor)

Ok, all you need to do is remove the “== ItemActor” - the cast will only be true when it’s a Key Class 1.

If you’re wanting to test if the picked up item is the same class as whatever ItemActor is at the time - you can call “GetClass” on both objects and check if they ==.

1 Like

Totally works. Thank you!

1 Like