How to Use Blueprint Interfaces In UE5.1

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 54

  • @ACouchpirate
    @ACouchpirate Рік тому +23

    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.

    • @SavageDevs
      @SavageDevs  Рік тому +3

      It does depend on what needs to be done.

    • @kenalpha3
      @kenalpha3 Рік тому +1

      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.

    • @ethanwasme4307
      @ethanwasme4307 Рік тому +1

      ​​@@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

  • @IvanDBeltran
    @IvanDBeltran Рік тому +2

    Subscribed! Recently moved from C# to Blueprints and was wondering how to implement interfaces. Thank you!!!

  • @hiagooliveira6510
    @hiagooliveira6510 Рік тому +3

    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

  • @lonewolfenock3527
    @lonewolfenock3527 Рік тому +3

    Thanks. That was the simplest most direct explanation of interfaces. Now I'm not scared any more =)

    • @SavageDevs
      @SavageDevs  Рік тому +1

      Glad you liked it it was a pain to learn but they are very useful!

  • @undisclosedpolitics
    @undisclosedpolitics Рік тому +1

    Great tutorial and explanation. Thank you!

  • @stu4amie
    @stu4amie Рік тому +1

    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.

    • @SavageDevs
      @SavageDevs  Рік тому

      You are welcome, maybe after I finish school I will start posing again, I am just very busy with my school rm.

  • @barancanuzun8435
    @barancanuzun8435 11 місяців тому

    Great tutorial! Thanks

  • @bywatt2058
    @bywatt2058 Рік тому +1

    great tutorial. thanks

    • @SavageDevs
      @SavageDevs  Рік тому +1

      Your welcome! If you are interested in more high quality tutorials please feel free to watch my playlist on UE5.

  • @kisekinomahou
    @kisekinomahou 11 місяців тому

    TY!

  • @MonderMurshed
    @MonderMurshed 10 місяців тому

    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.

  • @StBlueFire
    @StBlueFire Рік тому +6

    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!

    • @SavageDevs
      @SavageDevs  Рік тому +2

      That sounds smart surprised I did not think about it myself. I have other videos on similar stuff it you liked this one.

    • @hiagooliveira6510
      @hiagooliveira6510 Рік тому +1

      @@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? :)

    • @SavageDevs
      @SavageDevs  Рік тому +1

      I am working on the starts of an inventory tutorial. Won't be out for a bit though.

    • @StBlueFire
      @StBlueFire Рік тому +1

      @@SavageDevs If you want some early feedback I'm happy to help if you find it useful.

    • @SavageDevs
      @SavageDevs  Рік тому

      @@StBlueFire Cool, Cool.

  • @dko-JackSkalington
    @dko-JackSkalington Рік тому +1

    Subbed. Good stuff.

  • @UltimatePerfection
    @UltimatePerfection Рік тому

    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.

    • @SavageDevs
      @SavageDevs  Рік тому

      Just drag it back into the main window and it will become a tab.

    • @UltimatePerfection
      @UltimatePerfection Рік тому

      @@SavageDevs And it will open in future as a tab?

    • @SavageDevs
      @SavageDevs  Рік тому

      @@UltimatePerfection Depends the editor is dumb sometimes.

  • @Gensokian
    @Gensokian Рік тому

    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?

    • @SavageDevs
      @SavageDevs  Рік тому

      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.

  • @rifffz
    @rifffz Рік тому +1

    Great

    • @SavageDevs
      @SavageDevs  Рік тому +1

      You are welcome! Thanks for watching!

  • @dwisenhower
    @dwisenhower Рік тому +1

    Seems its not making it to the bpi event node on my second object. I must be missing something here

    • @SavageDevs
      @SavageDevs  Рік тому +1

      I cant see your code and this might sound dumb but you might of forgotten to save and compile?

    • @dwisenhower
      @dwisenhower Рік тому +1

      @@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

    • @SavageDevs
      @SavageDevs  Рік тому +1

      @@dwisenhower Glad you got it sorted out. Also shameless plug if you need a settings menu I made a video on that.

  • @vincebgamedev7455
    @vincebgamedev7455 Рік тому

    u dont need to set the shard count again , the increment int node adds 1 and sets the integer on the connected reference

    • @SavageDevs
      @SavageDevs  Рік тому +1

      As far as I aware the code does not work without a set node.

    • @fatalbreak
      @fatalbreak Рік тому +1

      @@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.

  • @thelawgameplaywithcommenta2654

    Great except the stiffness of the presentation. For example instead of saying "next compile, next save" you could say, "compile and save".

    • @SavageDevs
      @SavageDevs  Рік тому +1

      Thanks for the feedback I will use it in my next video on making a settings menu

    • @vrisvictorious9922
      @vrisvictorious9922 Рік тому +1

      Stiff? Enunciation and perspicacity!

    • @SavageDevs
      @SavageDevs  Рік тому +1

      Thanks!

  • @Pierraxl
    @Pierraxl Рік тому

    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

    • @SavageDevs
      @SavageDevs  Рік тому +2

      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.

    • @Pierraxl
      @Pierraxl Рік тому +1

      @@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 !

    • @SavageDevs
      @SavageDevs  Рік тому +1

      @@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.

  • @Rehd66
    @Rehd66 Рік тому

    I keep reading that you can't use those variable icons anymore, yet I keep seeing them in videos. What gives?

    • @SavageDevs
      @SavageDevs  Рік тому

      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
      @Rehd66 Рік тому

      @@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

    • @SavageDevs
      @SavageDevs  Рік тому +1

      @@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.