Cast is bad?

Good afternoon, I heard that casting is bad in blueprints and as I know it is better to use interfaces in blueprints, but what can be used in c ++?

You can use an interface in C++ also. The syntax is weird. Here is some links to some helpful info I have found over the course of my learning. However, I believe casting in native C++ is not as bad as in blueprints. You want to use an interface to decouple code. Mainly if you have a potential circler dependency. But I’m not a master programmer I’ve only got 2 years of experience. But as long as the class I’m casting to doesn’t need to know about the class I’m using it in I’ll just cast. Otherwise, I’ll use an interface or delegates depending on the functionality I’m looking for.

Interfaces In C++ | Unreal Engine Community Wiki (unrealcommunity.wiki)

Unreal Engine C++ Fundamentals – Interfaces! – Jolly Monster Studio

UE4 - Declaring and using interfaces in C++ - Isara Tech.

Interfaces in C++ - Old UE4 Wiki (nerivec.github.io)

Thanks for the answer. And really, a very strange syntax, it looks like some kind of crutch, in blueprint with them easier.

Privacy & Terms