# The real problem of blueprint CastTo

**URL:** <https://forums.unrealengine.com/t/the-real-problem-of-blueprint-castto/1185057>\
**Category:** Programming & Scripting\
**Tags:** Optimization, unreal-engine, Performance, Blueprint, question, CPP\
**Created:** [May 31, 2023, 11:34pm UTC](https://forums.unrealengine.com/t/the-real-problem-of-blueprint-castto/1185057 "2023-05-31T23:34:51Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Roy\_Wierer.Seda145](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/roy_wierer.seda145/32/906551_2.png) [@Roy\_Wierer.Seda145](https://forums.unrealengine.com/u/Roy_Wierer.Seda145)\
**Post date:** [June 1, 2023, 8:57pm UTC](https://forums.unrealengine.com/t/the-real-problem-of-blueprint-castto/1185057/5 "2023-06-01T20:57:47Z")

</div>

> [@Everynone](#):
>
> casts go brrr…

Curious, what did you benchmark there? In the editor with all other things running at the same time it’s hard to be accurate… maybe when testing a million runs I don’t know XD.

There’s something else going on with interfaces, in c++ you have to do multiple checks to get a proper interface cast depending on if the interface is blueprint only or not. Extremely frustrating.

```auto
bool bCanBeGrabbed = false;
if (OtherOwner->Implements<UGrabInteractionInterface>()) {
	bCanBeGrabbed = IGrabInteractionInterface::Execute_CanBeGrabbed(OtherOwner, InPrimitiveComponent);
}
else if (const IGrabInteractionInterface* OtherInterface = Cast<IGrabInteractionInterface>(OtherOwner)) {
	bCanBeGrabbed = OtherInterface->CanBeGrabbed(InPrimitiveComponent);
}

```

---

_[View the full topic](https://forums.unrealengine.com/t/the-real-problem-of-blueprint-castto/1185057)._
