How to... Cast Vs Interfaces

preview_player
Показать описание
How to know when to use cast or interface? Is cast or interface better? What does casting do? How do interfaces work.

Welcome to How to... a snack-size video for a snack-size question in Unreal Engine 4.

SUPPORT ME

PRIVATE 1-2-1 SESSIONS

JOIN THE COMMUNITY

FOLLOW ME
Рекомендации по теме
Комментарии
Автор

you kinda forgot another VERY useful feature of Interfaces. You can call a function without loading all reference chains. a prime example of this is the Game Mode. if you cast a Game Mode and it references 20 other things, it loads all those references via a Cast. calling an Interface function on the Game Mode does not load all the references.

problemchild
Автор

The only thing that I see was missing in the video, you hooked up the interface call from that previous cast... Which could lead people to think that they still need to do the cast... When you're using interfaces you don't ever really need to cast to anything you just send an interface message and if it has a matching interface it'll interact.
It's also important to note that when you're calling that interface function that you choose the one that says (message).

omegablast
Автор

Would love more explanation on when you should use Casting or Interface and the tradeoff in doing so. For example code complexity or CPU price with Casting or what are the downsides using Interfaces. Also some more complex example of interfaces would be wonderful. Thank you.

EveryGoodWorkInc
Автор

this channel is a GEM for unreal engine beginners!!! most of the tutorials ive seen tell you what they are doing but don't really explain what those nodes really are !!! tutorials like this one are amazing i wish he could do more of them

ralphhleihel
Автор

Just want to say that interface is better in general, if you need to make some big changes cast will make everything WAY more difficulty to change.

heliaxx
Автор

Sounds like if I want to make a damaged system for my game I probably want to use interfaces.

FireFox
Автор

Hopefully I'm understanding. So casting would be good for something specific and then Using the Blueprint interface would be much better for a pick ups system or damage system to the player. For instance if you have 5 different pickup options with different effects, it would be better to go with the blueprint interface route.

Thank you for the video btw!

lingster
Автор

You mentioned using an interface for online, I'd love to know more about that sort of implementation.

DJMD
Автор

Maybe you can help Ryan, but none of these tutorials on this subject shows you how to do with between widgets, like not using "Actors" Would you know the node to use for this? Thx much!

IspyrGameDev
Автор

I wish more UE youtubers did more videos on proper design patterns. I am just learning about interfaces after dozens of tutorials and I came across them while reading a book on progamminh designs.

Its seems really important when it comes to elegent code.

NewMateo
Автор

Hi Ryan! Thank you for the tutorial!
When 2 different classes implement an interface and one of them is loaded into memory, does that mean that all the other classes that implement the interface are also loaded?

Karlettto
Автор

Hello ryan I have a question which might seem stupid but I don't know why we cast, like rather than casting to a character why don't we just make a new variable with the type of the character and do the changes we need in a certain events?

AlexFord-gpby
Автор

Does that mean it's bad practice to cast to game mode from within an actor to pass information?

In my current project I was casting to game mode to get a global gm variable - I moved over to using interfaces - but was my initial solution not the right way to go about it?

Momijisu
Автор

I really like this environment. Can you point me to it in the marketplace? haven't found it yet.

danpaul
Автор

Ryan is it ok to have too many(like20 or 30) interface functions and events inside one blueprint does this effect performance? Noob question sorry.

falsehero
Автор

Can you do a tutorial of flying like the griffins in ARK Survival Evolved???
I know flying is difficult but is the main part of my game
Thanks if you do!

gameriltsforever
Автор

Once I got past the heavy Bri-ish accent, I realized that your way of explaining this stuff is the Most helpful. Thanks!

murnoth
Автор

If i make a get pawn in the controller i get an acess non trying to read property. How do i cast to pawn for multiplayer properly?

pietpanzerpanzer
Автор

This is all still extremely confusing. Main reason is everyone trying to explain interfaces uses the player character at a starting point. What if you need level blueprint to interact with events within actors in the level?

MonsterJuiced
Автор

Can you please tell me the name of the level?

AlexFord-gpby