# Is there a way to "Switch On Class"?

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-switch-on-class/319644>\
**Category:** Platform & Builds\
**Tags:** Switch, unreal-engine, UE4, question\
**Created:** [May 24, 2015, 6:20pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-switch-on-class/319644 "2015-05-24T18:20:52Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![PixelFireXY](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pixelfirexy/32/1195765_2.png) [@PixelFireXY](https://forums.unrealengine.com/u/PixelFireXY)\
**Post date:** [June 11, 2024, 9:03am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-switch-on-class/319644/12 "2024-06-11T09:03:50Z")

</div>

I know this post is old but I found a solution to compare which Sense is which and keeping a reference comparison at the same time. Just create a macro and do the reference comparison inside it.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/a/9/8a9fecd7251f4be49cb2838f96b7e2184e1a05a6.png)  
And then you call the macro like this:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/e/b4eed924724a131b30ed6048f291685bf8e6f034.png)

This is gross, I know… but at least you do not compare class names with strings but with references.

---

_[View the full topic](https://forums.unrealengine.com/t/is-there-a-way-to-switch-on-class/319644)._
