Begin Overlap On Sphere Collision

Hi,

I think this is a simple problem but I just can’t seem to get my head around it.

So I extended the character class simply by putting a Sphere Collision around the character mesh. I then popped a couple of event for overlap start and finish.

The events fire correctly when my character moves in and out of the bounds but the cast from other Actor doesnt work? Can anyone explain why? I thought a character was derived from actor?

Character is a child of Actor… As far as I know everything which is placed inside of a level is one. Some mesh might not be but that’s besides the point right now.

Could you try to print the class or the name of this other actor to check what you get instead of the character you want?

Using the function GetDisplayName it returns MyCharacter, which is the class Im trying to cast to.

Could you try just casting to character instead of “MyCharacter”?

Ahhh good idea! And yes that cast successfully. Why wouldnt it cast to mycharacter?

Alright that’s interesting. We’re getting somewhere.

Now the easiest and most simple solution would be that you have two “MyCharacter” classes spelled very similarly and picked the wrong one.

Just in case could you try to not only get the name but the class of the actor and print that out?

It would be nice if I had two classes like that lol but alas no I dont.

How can I print the name of a class? I thought thats what get display name did

Scratch that, I used the function GetClass, and then did an equals and compared it to the MyCharacter class. This succeeded.

This doesnt make much sense :\

I thought for a moment that I casting Actor → Character → MyCharacter would work instead, but it didnt :frowning:

Didnt think this was possible

It looks like the cast actually does succeed but the debugger doesnt show it.

Alright that is weird as hell…

But it does work right?

If so could you answer this post yourself just telling to look up here and post another question on the “Bug Reports” section of this hub with this picture and a short explanation?

Thanks and have a good one :slight_smile:

Yea it seems to work, my money is on editor bug. Thanks for your help though.

Answer seemed to be that the execution was working as planned but the editor was reporting incorrect execution.