# Can't cast to the same class?

**URL:** <https://forums.unrealengine.com/t/cant-cast-to-the-same-class/2873187>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [November 25, 2026, 7:54pm UTC](https://forums.unrealengine.com/t/cant-cast-to-the-same-class/2873187 "2026-11-25T19:54:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DigitalSketch](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/digitalsketch/32/915323_2.png) [@DigitalSketch](https://forums.unrealengine.com/u/DigitalSketch)\
**Post date:** [November 25, 2026, 7:54pm UTC](https://forums.unrealengine.com/t/cant-cast-to-the-same-class/2873187/1 "2026-11-25T19:54:01Z")

</div>

I’m doing a tutorial for my class, and it’s trying to cast the OtherActor from an OnOverlapBegin function to my player character class, but it’s giving me this error and won’t build. Anyone know why?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/8/06846b530ad0b32a7e44890218343a698a6d47c1.png)
