Тёмный

Unreal Engine 4 C++ Tutorial - Using Interfaces - UE4 / Unreal Engine 4 Intro to C++ 

Dev Enabled
Подписаться 40 тыс.
Просмотров 18 тыс.
50% 1

This Video:
In this video, we look at the use of Interfaces in C++, how to create, implement and send messages through Interface functions.
Intro to C++:
Intended to be the true intro to C++ for UE4. This playlist is intended to focus on one topic at a time and explain how, why and when they work. Think of it as documentation in video form.
Chapters:
00:00
00:10 - Intro
01:15 - Creating Interfaces
02:08 - Interface Header
03:41 - Character Header
05:23 - Character Code
06:25 - Calling Interfaces
11:22 - Testing Results
Consider supporting the channel on Patreon: / devenabled
Links:
Download free projects from complete tutorial series and more: mega.nz/#F!imQ...
Join the Dev Enabled Discord: / discord
Get my new UE4 Beginners course: devenabled.tea...
Beginner course now available on Udemy: www.udemy.com/...
Gamedev.tv Courses - Affiliate Links:
Unreal C++ Developer: www.gamedev.tv...
Unreal Multiplayer: www.gamedev.tv...
Unreal Blueprints: www.gamedev.tv...
Blender Characters: www.gamedev.tv...
Get a FREE Pluralsight trial and support the channel: pluralsight.px...
My First Pluralsight Course: pluralsight.px...
My Second Pluralsight Course: pluralsight.px...
My Third Pluralsight Course: pluralsight.px...
Check out my Website: devenabled.com/
Twitter: / robbcreates
RECOMMENDED READING - Game Theory Books -
Theory of Fun for Game Design: amzn.to/2Y7a29z (Personal Favourite)
Game Feel: A Game Designer's Guide to Virtual Sensation: amzn.to/3159Dl5 (Another read I couldn't put down)
Level Up! The Guide to Great Video Game Design: amzn.to/2MkxcC8
The Art of Game Design, Second Edition: amzn.to/2JY6EVz
Rules of Play: Game Design Fundamentals: amzn.to/2YcfsA7
Game Programming Patterns: amzn.to/2YbXnC2
Drawing Basics and Video Game Art: amzn.to/2Ml6FVb
Sound Effects (BFXR): www.bfxr.net/
Get Affinity Designer: affinity.serif...
Get Unreal: www.unrealengi...
Get Some great free assets here: www.gamedevmar...
#ue4, #unreal_engine, #Cpp, #interface

Опубликовано:

 

18 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 53   
@DevEnabled
@DevEnabled 3 года назад
Get my new UE4 Beginners course: devenabled.teachable.com/p/intro-to-ue4/ Beginner course now available on Udemy: www.udemy.com/course/unreal-engine-4-ue4-complete-beginners-course/?referralCode=FB8E232D20F4A087F6D5
@seahawk913
@seahawk913 2 года назад
Finally an understandable and nicely presented explanation about how to use interfaces in UE C++ :) Thank you!
@DevEnabled
@DevEnabled 2 года назад
Thank you and great to hear it's helped, Interfaces are very useful.
@matrixcn73271
@matrixcn73271 Год назад
Incredible tutorial. I was banging my head just trying to figure out how to properly use these. It's hard to find really good information. Thank you so much! You're a great teacher!!!!
@jevinscherries
@jevinscherries 3 года назад
Where was this earlier this week when I was implementing an interface in C++ :D Thanks for the knowledge, and keep up the good work.
@DevEnabled
@DevEnabled 3 года назад
Damn, my timing is usually a little better...
@qcgeneral29
@qcgeneral29 2 года назад
This video was exactly what I was looking for. Thanks!
@ockertnel2458
@ockertnel2458 Год назад
Thank you for showing the C++ way struggled to find an example like this most videos were showing C++ interface just used in blueprint
@God0fTime
@God0fTime Год назад
i wished you showed what file you were in at the top but this still helped greatly , thank you
@giovannisierra112
@giovannisierra112 Год назад
Great Programming focused video for someone getting knowledge into Unreal engine C++. I hope you can make more like this.
@Muhammad_Abdullah_Sultan
@Muhammad_Abdullah_Sultan 3 года назад
Amazing tutorial
@noctua7771
@noctua7771 3 года назад
OH MY GOD, YOU DESERVE SO MANY MORE SUBSCRIBERS!
@Dronium1
@Dronium1 2 года назад
Thank you so much! It was really useful!
@reiderjack7531
@reiderjack7531 2 года назад
Informative video about interfaces, thank you!
@aleca8910
@aleca8910 2 года назад
Very, very interesting. Thank you for this.
@Nanakoglasgow
@Nanakoglasgow Год назад
very helpful thank youu
@theFishy_
@theFishy_ 3 года назад
Nice
@igotbit9454
@igotbit9454 2 года назад
very helpful. love it. thanks a lot.
@milos_slav_sky
@milos_slav_sky 4 месяца назад
The difference between methods is that you couldn't use the second one with Blueprint classes, which don't inherit interfaces, but just implement them. This way they just couldn't interact, even if they implement Interact function in their Blueprints properly
@heavyrainstudio5798
@heavyrainstudio5798 3 года назад
very Simple!!! thank
@kyrylokravchuk9933
@kyrylokravchuk9933 2 года назад
Thank you! Wow
@thehambone1454
@thehambone1454 Год назад
Amazing, thank you, I was looking for literally this. I needed a way to generically interact with different type of objects, I guess this is common in gamedev ;). Does this work exactly the same in UE5?
@ginkerzo8954
@ginkerzo8954 3 года назад
Really nice video, good job ! I have a little question if it is not bothering you, In character.h I would have done virtual void OnInteract_Implementation() for override in BP the function like you have done in your tutorials about interface and not void OnInteract_Implementation() override for the blueprint case. Why this difference between this video and the tuto ? Thanks again for your time and explanations
@SurviveOnlyStrong
@SurviveOnlyStrong 2 года назад
Hello, how can I expose a c++ interface method to the blueprints as a message? So I can call it via blueprints without casting. Currently I can call it only as a function
@GeNN18192
@GeNN18192 2 года назад
Thanks for the exlanation. Is it a practice in unreal to have actual default implementation in the interface.cpp? Or is that not a thing?
@yrussq
@yrussq 3 года назад
Nice! It would not hurt to mention and point out specifically and unequivocally that "_implementation" suffix and "execute_" prefix is a UE only thing. It's counterintuitive why you've declared one function names in the interface while implementing the others in the class. Implementation is a programming term, the fact the Epics reinventing the way the language works and use the programming terms frivolously for their own amusement is really getting on my nerves.
@tommiemartin1596
@tommiemartin1596 6 месяцев назад
In 5.3 I get duplicate symbol linker errors if I have the _Implementation functions in the class that gets the Interface. Works fine withou them 🤷‍♀
@jalsiddharth
@jalsiddharth 3 года назад
I think I got this. Can we have a more detailed video with practical examples? Please correct my understanding. You create an interface which your character class implements. Then you cast to type interfaceclassname and as long as the cast is successful you are able to call the functions from the interface. Why am i going through this headache? Is the idea to avoid lots of includes and casts and checks to be able to call character specific functions? Or did all this just go over my head? Thanks Rob!
@DevEnabled
@DevEnabled 3 года назад
Pretty much, plus the reasons I mention in the video. It creates a more agnostic class structure with fewer dependencies. It can open opportunities for emergent gameplay with completely unique classes sharing similar functionalities. It's a slightly older playlist but I have covered Interfaces in context of a slightly larger project so that might help here: ru-vid.com/group/PL9z3tc0RL6Z4JJS__Bge8O2mLwKUaG1eU
@jalsiddharth
@jalsiddharth 3 года назад
@@DevEnabled thank you so much. I get it now. :) Had a request. Can you make a tutorial on using damage type classes in C++? :) I'm a bit confused as to how to use it other than enums but still that doesn't make sense as we end up creating multiple damage type classes just for enum. There has to be more.
@sotanaht13012
@sotanaht13012 2 года назад
I think that if you try to store in a IInteractInterface a blueprint that implements that interface, it cannot work : blueprints implementing this do not really implement that interface, they just mimic it and that's why we have to use the execute_ and implements interface stuff If you implemented the interface in CPP thought no problem but keep in mind that the interface is available to any data creator (unless not blueprint able I think)
@ikanuutinen
@ikanuutinen 3 года назад
EDIT: Breaking the link between InputAction Interact and LineTraceByChannel fixed the issue. Hey! I'm following your old UE4 C++ series and i ran in to an issue with the interface. The debug traces and object focus work, but the Destroy() command does nothing. I can't manage to figure out a way to destroy the object even though i've followed the code in the tutorial in every part. It shows that my inputs are being registered, but the removal of the object i can't figure out. No error messages either. I'm thinking that there could be an issue with the destroy command not being actived from the Input_Implementation line. Any ideas for solutions to try or other ways to recreate it? Thanks for the help!
@matt-g-recovers
@matt-g-recovers 3 года назад
Is this playlist /series the more comprehensive? I really like your content and have learned a lot so far. Thank you so much for making this dev a bit more enabled.
@UnrealogyTutorials
@UnrealogyTutorials 3 года назад
This is a quadrilateral formed by reversing the charge of proton pump inhibitor of the elements of the eternal cosmos bank account details are scammed by tech support scammer
@gamescreator5040
@gamescreator5040 3 года назад
HI! I really like your videos, thanks a lot! Definitely like from me. They are very useful for me as for unity developer. And it would be good see from you videos about SOLID in Unreal engine 4.
@DevEnabled
@DevEnabled 3 года назад
That's great to hear thank you. If you haven't seen it already be sure to check out the Unity to Unreal playlist on the channel if that's where you're coming from. I'm not too sure what SOLID is in Unreal though.
@gamescreator5040
@gamescreator5040 3 года назад
@@DevEnabled I think solid is same everywhere. But in Unity for example We can easily create a non MonoBehaviour class for something, but I don't sure how to do this in Unreal. I Mean it would be good in general to see from you little game architecture with pure OOP approach. Because there is lack of good c++ tutorials on RU-vid. Only blueprint stuff
@UnrealogyTutorials
@UnrealogyTutorials 3 года назад
@@gamescreator5040 The Small Intestine to the rescue the depressed and the Bois a good day please find attached the same the answers the questions ☺️ rufutu the same 🐱 to have enough time to complete electromagnetic radiation therapy in the last word
@cafo5997
@cafo5997 3 года назад
Question: in this way can we implement a "default behaviour" any class that implements the interface should have if the virtual function is not overridden? I think no, beacuse the initial function declaration is virtual pure( = 0 ). Any workaround to this fact? The only thing that come to my mind is to implement a default behaviour for every parent class we want to implement the interface in, going to specify more to his children. But this still asks you to implement a default behaviour every time, at least in the "top" classes. Really good video my man, keep up the good work!
@DevEnabled
@DevEnabled 3 года назад
Thanks. I think what you're looking for is leaning back more on inheritance, so like you said having a base class that implements the interface and has a default use of the interface function that all child classes will inherit and override if needed.
@ajk7733
@ajk7733 3 года назад
I noticed that you are using rider, may i ask you how you got it working with the current version of UE4 ? The plugin comes now with UE4 and is enabled by default, however i can't pick rider from the IDE selection menue...
@DevEnabled
@DevEnabled 3 года назад
Unfortunately, I don't remember having any issues with it in 4.25 or 4.26. I've just installed it to the engine version through the Epic Launcher and selected it as the IDE in the project settings. Could be that you just need to uninstall/reinstall it and under File click Refresh Rider project, if you see that option.
@ajk7733
@ajk7733 3 года назад
@@DevEnabled thank you for your quick answer, for some reason it's still not working for me. The plugin is activated but Rider isn't showing up in the IDE list, Visual Studio, VS Code and Clion are there but no Rider. I guess i will have to contact the support.
@MegaMitrandir
@MegaMitrandir 3 года назад
and what about if you need to pass some parameters
@letenebrae3164
@letenebrae3164 3 года назад
How did you create these Cpp subfolders?
@DevEnabled
@DevEnabled 3 года назад
/"NameOfFolder" when creating a new class, after the default location and it works everything out for you past that.
@letenebrae3164
@letenebrae3164 3 года назад
@@DevEnabled Ok. And this new folder has to be created from the IDE before creating the class itself in the UE Content or dont need to?
@DevEnabled
@DevEnabled 3 года назад
@@letenebrae3164 Nope, just the process I described there.
@davedumas0
@davedumas0 3 года назад
can you make a tutorial series on remaking this game in UE4 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-RkoNHEwvftI.html with a standard controls(that was the games main issue was control scheme was weird) the name of the game is "NOCTIS" the premise is millions or billions of years after present day a race of cat people that was exploring the galaxy and the galaxies state is after the merger between Andromeda and the milky way and after earth is LONG GONE
@karthikeyas5753
@karthikeyas5753 3 года назад
First :)
Далее
Learn Unreal Engine Networking in 30 Minutes
27:25
Просмотров 103 тыс.
Laser Eyes Tutorial - Unreal Engine
18:58
Просмотров 3,1 тыс.
C++ Interfaces Pt 1/3 UE4 / Unreal Engine 4 C++
11:04
Learn Unreal Engine C++ In One Hour
55:43
Просмотров 286 тыс.
Unreal Engine C++ Tutorial for Beginners (1/3)
42:10
Просмотров 34 тыс.