Why on earth isn't this working?

Just trying to perform a simple check to see if the overlapping object is an arrow in the blueprint of a pawn. (i.e. did this pawn just get hit by an arrow?) It only returns as false. Any ideas?

P.s. I’ve printed the other actor and it is the exact arrow just to verify.

do you want to check to make sure it is a specific actor, or just that the actor is a certain class?

If you want to check for a specific actor, you might use a tag, or set a reference either directly or with an interface. Lots of options really and it depends on your project setup to find the best option, so details help with making that decision.

If you want to check class, try this:
image

(not the get player pawn, that is just example of some actor being used as input)

Your confusion is probably coming from not understanding class/object. Might find some explanations here useful:
unreal difference between class and object - YouTube

3 Likes

Get actor of class iterates through all the actors in your level and stops at the first actor of the class that you specified that it finds. So you can understand that it’s very inefficient, and should be used very rarely.

Use a cast if you want to check if an object is of some type, so just right click and search for Cast to BP Arrow New. A cast node takes an input object and checks if it’s of the specified class. If it is then you can use it as that class, and access its functions and variables.

That did the trick! Thank you. And yes, I appears I do have a fundamental misunderstanding of objects/classes and will read up!