# I found a video called "Learn why you should NEVER use Casting in Unreal Engine" (How true is this ?)

**URL:** <https://forums.unrealengine.com/t/i-found-a-video-called-learn-why-you-should-never-use-casting-in-unreal-engine-how-true-is-this/1859493>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [May 16, 2024, 10:52pm UTC](https://forums.unrealengine.com/t/i-found-a-video-called-learn-why-you-should-never-use-casting-in-unreal-engine-how-true-is-this/1859493 "2024-05-16T22:52:46Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [May 17, 2024, 7:24am UTC](https://forums.unrealengine.com/t/i-found-a-video-called-learn-why-you-should-never-use-casting-in-unreal-engine-how-true-is-this/1859493/7 "2024-05-17T07:24:35Z")

</div>

When you need a lot of casts (not to base classes) you sometimes just want to split up functionality into new classes or components, as that can often reduce casts count. Casting to the engine classes is still very common and there is nothing wrong with it. When using interfaces (as a best practice for decoupling) you are going to be casting as well.

Youtube videos are 99.9% clickbait. It’s expected to see a large increase in memory when a class you are loading into memory holds hard references to other classes / assets. Say a blueprint has a property / node referencing a class / texture / sound / level and so on through a HARD reference, they will be loaded into memory immediately (and **recursively** ) when that class is loaded into memory. This is why people use soft references, which are nothing but paths that can be loaded on demand.

> [@catz111](#):
>
> Yeah i see that’s in the video too. For some reason my enemy bp is 6gb and 5gb memory. There are no nodes on the event graph. The whole thing is pretty much empty. This size map shows me that it loads some textures from other player characters that i have.

@catz111 that would be shocking. I think it’s loading something recursively through a property / component / etc that looks innocent but isn’t. Like a datatable reference holding hard pointers to other things like textures.

> 

> [All about Soft and Weak pointers | Tutorial](https://dev.epicgames.com/community/learning/tutorials/kx/all-about-soft-and-weak-pointers)

> [The real problem of blueprint CastTo - #2 by Roy\_Wierer.Seda145](https://forums.unrealengine.com/t/the-real-problem-of-blueprint-castto/1185057/2)

> [Blueprint interface VS ActorComponent, The Good And The Bad](https://forums.unrealengine.com/t/blueprint-interface-vs-actorcomponent-the-good-and-the-bad/506136)

> [Die to Survive - Railshooter - #240 by Roy\_Wierer.Seda145](https://forums.unrealengine.com/t/die-to-survive-railshooter/552867/240?page=13)

---

_[View the full topic](https://forums.unrealengine.com/t/i-found-a-video-called-learn-why-you-should-never-use-casting-in-unreal-engine-how-true-is-this/1859493)._
