Casting isn't inherently bad, and I wish people would stop spreading that notion. In fact interfaces can be just as bad if used improperly, same goes for actor components. Interfaces aren't a 1:1 replacement for cast nodes. Sure, in the example presented in the video an interface is more than likely more appropriate, but that won't be the case 100% of the time, yet that's how it's presented in this video. They're all tools that are appropriate for some situations and less appropriate for others.
I want to get the current variable in Actor 1 and send to Actor 2, without using specific Casts. What should I use? E.g. a Capsule Trace node > Hit Actor > [not Cast To] but I need to get a variable that is inside CharacterBP_myChar (and the variable is not in vanilla CharacterBP). But what I had to do was pull off Hit Actor pin > Cast to Generic CharacterBP (to check if it is a character type), if yes then as "CharacterBP" > set that as a Character variable (Because Hit Actor ref does not equal Character Object ref). (Im still not getting the variable INSIDE MyCharBP.) So then I use BPI, with the Target as the Hit Character variable. Then I have to do BPI trigger even inside the BP of MyCharacter, to try to affect its internal variable.
@@kenalpha3whatever that variable is should be in another class tbh you want the controller to send events not receive them... it's probably late to refactor anything in a controller class so just plan a bit better next time
Hey man, loved the tutorial, I'm surprised you only have a few hundred subscribers! I hope everyone finds out about you, you have very nice and to the point tutorials
Getting the object reference through the interface has completely opened Unreal Engine to me. I’ve been looking through every tutorial on the subject and nobody showed how to do it. Thank you so much. You’re like a paracetamol when I have the worst headache.
I have some problems can u help me please. What should i put in the target? in the function?. I don't wanna create begin overlap node, there is something i can do to fix that or the overlap is the only way to get the target for the function?. thx for the video though.
Nice and simple! I would consider adding the pickup objects to a map variable (name/text/string to integer/float). Then you can keep all code for soulshards on the soulshard itself and if you add 10 more pickupable items you don't have this "equal class node" x10 with relevant logic. On the soulshard your interface call would include that name/text/string. Then write a bit of logic to add to the map appropriately. Now you can create inventory items by just making a new BP and change its name variable!
What did you do to open stuff like blueprints, materials, etc. in new tabs? When I double click anything in the content browser (say, a material), it opens brand new Unreal window.
Just out of curiosity; Why use the Interface and re-define the function when I could just create a function in the blueprint itself with inputs and outputs?
This gets more helpful when you have 90 blueprints that all need to do something when they see this function but the something can change depending on the blueprint. It is like a header file in C programing.
@@SavageDevs The problem was the target on the BPI. It needs to be set to the item youre communicating with, i use a "Get all actors with interface" then connect to the target, for my use case. This way every BP that has the BPI receiver event will be triggered
This is useless, it work the same without interface ! Create Cylinder count in the first person character, then in the cylinder bp cast to character, as first person character get cylinder count and increment. PLUS, no need to set it, incrementation already set it for you. Why bother so much like that ? this is bad coding
This is an example of how to use interfaces. Because they are more efficient than casting so if you used them throughout a project instead of casting you can make your game run faster and be more readable.
@@SavageDevs Oh i see, in term of performance for a very big game i would see the point of this. Then i would recommand maybe remake a tutorial with multiple interfaces !
@@Pierraxl I just make these to show off the how use then it is up to the watcher to apply it. Also a tutorial of me doing the same thing to 100 different objects dose not make for prime UA-cam viewing experience.
1) I have no clue what you are talking about as I made this video months ago so I dont know what icons you are talking about. 2) If that changed recently this video is many months old, whatever it was, it was normal months ago when I made the vid..
@@Rehd66 That should just be a visual thing. Sorry if I sounded that way it was early in the morning when I responded. I think it was just a visual change in an update.
Casting isn't inherently bad, and I wish people would stop spreading that notion. In fact interfaces can be just as bad if used improperly, same goes for actor components. Interfaces aren't a 1:1 replacement for cast nodes. Sure, in the example presented in the video an interface is more than likely more appropriate, but that won't be the case 100% of the time, yet that's how it's presented in this video. They're all tools that are appropriate for some situations and less appropriate for others.
It does depend on what needs to be done.
I want to get the current variable in Actor 1 and send to Actor 2, without using specific Casts. What should I use?
E.g. a Capsule Trace node > Hit Actor > [not Cast To] but I need to get a variable that is inside CharacterBP_myChar (and the variable is not in vanilla CharacterBP).
But what I had to do was pull off Hit Actor pin > Cast to Generic CharacterBP (to check if it is a character type), if yes then as "CharacterBP" > set that as a Character variable (Because Hit Actor ref does not equal Character Object ref). (Im still not getting the variable INSIDE MyCharBP.)
So then I use BPI, with the Target as the Hit Character variable. Then I have to do BPI trigger even inside the BP of MyCharacter, to try to affect its internal variable.
@@kenalpha3whatever that variable is should be in another class tbh you want the controller to send events not receive them...
it's probably late to refactor anything in a controller class so just plan a bit better next time
Subscribed! Recently moved from C# to Blueprints and was wondering how to implement interfaces. Thank you!!!
Hey man, loved the tutorial, I'm surprised you only have a few hundred subscribers! I hope everyone finds out about you, you have very nice and to the point tutorials
Thanks for the kind words!
Thanks. That was the simplest most direct explanation of interfaces. Now I'm not scared any more =)
Glad you liked it it was a pain to learn but they are very useful!
Great tutorial and explanation. Thank you!
Glad you liked it!
Getting the object reference through the interface has completely opened Unreal Engine to me. I’ve been looking through every tutorial on the subject and nobody showed how to do it. Thank you so much. You’re like a paracetamol when I have the worst headache.
You are welcome, maybe after I finish school I will start posing again, I am just very busy with my school rm.
Great tutorial! Thanks
great tutorial. thanks
Your welcome! If you are interested in more high quality tutorials please feel free to watch my playlist on UE5.
TY!
I have some problems can u help me please.
What should i put in the target? in the function?. I don't wanna create begin overlap node, there is something i can do to fix that or the overlap is the only way to get the target for the function?.
thx for the video though.
Nice and simple!
I would consider adding the pickup objects to a map variable (name/text/string to integer/float). Then you can keep all code for soulshards on the soulshard itself and if you add 10 more pickupable items you don't have this "equal class node" x10 with relevant logic.
On the soulshard your interface call would include that name/text/string. Then write a bit of logic to add to the map appropriately. Now you can create inventory items by just making a new BP and change its name variable!
That sounds smart surprised I did not think about it myself. I have other videos on similar stuff it you liked this one.
@@SavageDevs I'm trying to understand how we would implement this but I'm still too newbie! Would you be able to make a small guide with this idea? :)
I am working on the starts of an inventory tutorial. Won't be out for a bit though.
@@SavageDevs If you want some early feedback I'm happy to help if you find it useful.
@@StBlueFire Cool, Cool.
Subbed. Good stuff.
Thanks
What did you do to open stuff like blueprints, materials, etc. in new tabs? When I double click anything in the content browser (say, a material), it opens brand new Unreal window.
Just drag it back into the main window and it will become a tab.
@@SavageDevs And it will open in future as a tab?
@@UltimatePerfection Depends the editor is dumb sometimes.
Just out of curiosity; Why use the Interface and re-define the function when I could just create a function in the blueprint itself with inputs and outputs?
This gets more helpful when you have 90 blueprints that all need to do something when they see this function but the something can change depending on the blueprint. It is like a header file in C programing.
Great
You are welcome! Thanks for watching!
Seems its not making it to the bpi event node on my second object. I must be missing something here
I cant see your code and this might sound dumb but you might of forgotten to save and compile?
@@SavageDevs The problem was the target on the BPI. It needs to be set to the item youre communicating with, i use a "Get all actors with interface" then connect to the target, for my use case. This way every BP that has the BPI receiver event will be triggered
@@dwisenhower Glad you got it sorted out. Also shameless plug if you need a settings menu I made a video on that.
u dont need to set the shard count again , the increment int node adds 1 and sets the integer on the connected reference
As far as I aware the code does not work without a set node.
@@SavageDevs Increment Int uses a reference, not a copy, of the variable. When it increments, it will set the actual variable and not a copy of it.
Great except the stiffness of the presentation. For example instead of saying "next compile, next save" you could say, "compile and save".
Thanks for the feedback I will use it in my next video on making a settings menu
Stiff? Enunciation and perspicacity!
Thanks!
This is useless, it work the same without interface !
Create Cylinder count in the first person character, then in the cylinder bp cast to character, as first person character get cylinder count and increment. PLUS, no need to set it, incrementation already set it for you. Why bother so much like that ? this is bad coding
This is an example of how to use interfaces. Because they are more efficient than casting so if you used them throughout a project instead of casting you can make your game run faster and be more readable.
@@SavageDevs Oh i see, in term of performance for a very big game i would see the point of this. Then i would recommand maybe remake a tutorial with multiple interfaces !
@@Pierraxl I just make these to show off the how use then it is up to the watcher to apply it. Also a tutorial of me doing the same thing to 100 different objects dose not make for prime UA-cam viewing experience.
I keep reading that you can't use those variable icons anymore, yet I keep seeing them in videos. What gives?
1) I have no clue what you are talking about as I made this video months ago so I dont know what icons you are talking about.
2) If that changed recently this video is many months old, whatever it was, it was normal months ago when I made the vid..
@@SavageDevsYou sound offended :P
Look at your variable list on the left side. You see those blue icons next to them? Those are what I'm referring to
@@Rehd66 That should just be a visual thing. Sorry if I sounded that way it was early in the morning when I responded. I think it was just a visual change in an update.