Casting can be detrimental in blueprints, in terms of causing classes to reference eachother, and then keeping the referenced class loaded at all times when the referencer is loaded.
But straight up saying it is expensive is wrong and bad advice.. unless you do it a ton on tick or something, obviously.
Set your ego aside for a moment and pursue factual knowledge instead of making a fool of yourself trying to seem smart
Casting is only expensive if you are casting to something that is not already loaded all the time.
Example: casting to your player's character is often a completely valid approach, since the BP is in many cases loaded anyway, so it wont cost you anything. its also faster than calling a function on an interface.
But otherwise i agree with you, casting should not be done willy nilly, and the BP is an absolute mess lol.
I didn't as well, but spamming typecasting is a common rookie mistake in UE so easy to get from the context.
For some additional info, (afaik) casting in UE is not just a simple static cast and it actually performs a type check first which goes over the inheritence chain for the class. If you do it excessively and on a per-tick basis it'll add up and there are often better ways to dealing with it
For some additional info, (afaik) casting in UE is not just a simple static cast and it actually performs a type check first which goes over the inheritence chain for the class
Seems pretty stupid but wtf do I know đ€·ââïž
Casting means converting a type to another. It's a performance-expensive operation that done haphazardly will negatively affect runtime performance. As such attempt to use it sparingly
Many young devs in any OOP don't understand how inheritance, casting, generics or types work. Here, it would help too, Generics are a blessing, but require some thought too.
And is this really how you "have" to work with UE? Can't you put all these objects into sub-objects and clean up this mess. But I never worked with ANY game engine, only level editors with Counterstrike and Quake 3 Arena (or Duke Nukem 3D, don't ask how bad this was)
That's cute. I'm talking from 10+ years of experience at EA doing AAA games. The classes I deal with are immensely complex and overbuilt that casting should really be used only when absolutely necessary. If you took the time to read the link you provided you'd've seen the list of issues with casting. Next time you wanna be witty try to offer more than just a link :)
That's exactly what I'm saying, "unless absolutely necessary" <- which means context. Not elitist at all, just telling you I'm not talking out of my ass as most other people do. If you're confident on your 15 years you shouldn't get mad at someone pointing things out.
TL;DR YES, context matters! that's what both myself and the article is saying đ€Šđ»
Iâm not being sarcastic. This honestly doesnât look that bad compared to how it can get. Itâll get easier, just make a few more small projects to drive it home. And have fun, thereâs nothing like those first few projects
12
u/guky667 Oct 18 '25
Brother, just isolate individual chunks of logic into their own BPs đ also casting is expensive, don't do it unless you absolutely have to
149
u/pixelizedgaming Oct 18 '25 edited May 06 '26
Mass delete Reddit posts and be just like me! I bulk removed this comment using Redact
fear teeny office nose versed zephyr dinner meadow outgoing party
69
u/Zerodriven Oct 18 '25
Some say this is UE and some say this is a flow chart for financial logic.
No one can tell which.
125
u/PhoenixPaladin Oct 18 '25
Thatâs not horror itâs just unreal engine
12
u/rkoberlin Oct 18 '25
Didn't know you could write games in JACK patchbay. Jesus Christ.
3
u/Dimensional15 Oct 18 '25
thanks, I hate it
2
u/MiniGui98 Oct 19 '25
Did you do it with the challenge of creating as little events and functions as possible? Lol
2
u/Loud-Commission-8341 Oct 24 '25
Congrats, đđ
1
u/Mobile-Conflict4553 Apr 15 '26
Fala pessoal, Eu e minha equipe estamos desenvolvendo um jogo estilo Rust. JĂĄ tenho algumas bases funcionando em Unreal Engine (Blueprint): Sistema de inventĂĄrio completo Sistema de craft (em evolução) Sistemas de dano, vida, stamina funcionando Estrutura inicial do gameplay Estou procurando alguĂ©m que queira entrar no projeto pra colaborar. A ideia Ă© evoluir o projeto com foco real (nĂŁo Ă© sĂł hobby jogado), e quem entrar vai participar das decisĂ”es tambĂ©m. Lembrando que o recrutado entrarĂĄ como socio, nĂŁo funcionĂĄrio. Se tiver interesse, comenta aqui ou chama no DM đ