Hold 'E' To Interact | Time Dependant Progress Bar - Unreal Engine 4 Tutorial

Поділитися
Вставка
  • Опубліковано 19 тра 2024
  • Hey guys, in today's video, I'm going to be showing you how to hold a button to fire off code. For example, having to hold 'E' to interact with something. We will also be adding a visual progress bar on screen for the player to see. This will increase as the player holds the button.
    #Ue4 #UnrealEngine4 #Ue4Tutorial
    ___________________________________________________________________________
    00:00 - Intro
    00:19 - Overview
    01:10 - Tutorial
    16:30 - Final Overview
    16:50 - Outro
    ___________________________________________________________________________
    Unreal Engine 4 Tutorials Playlist: • Unreal Engine 4 Tutorials
    The Basics Of Nodes Playlist: • The Basics Of Nodes In...
    Blender Tutorials Playlist: • Blender Tutorials
    ___________________________________________________________________________
    If you enjoy make sure to subscribe: / @mattaspland
    Join My Discord Server: / discord
    Follow Me On Instagram: / matt_aspland_
    ___________________________________________________________________________
    If you want to support me, you can PayPal me at "matt.aspland.1@gmail.com". This is by no means expected or required. It is just a nice support :)
    Link to PayPal: www.paypal.com/
    You can also support me on Ko-Fi following this link: ko-fi.com/mattaspland
    Thank you :)
    ___________________________________________________________________________
    ♫Music By♫
    ●Kronicle - Chill Noons
    ●Soundcloud - / the-chemist-10

КОМЕНТАРІ • 79

  • @thefacelessman808
    @thefacelessman808 2 роки тому +21

    If anyone is having an issue with the widget not disappearing then do this: in your item BP add a "Do Once" between "Enable input" and "Create Widget" Then create a custom event and plug it in to the reset of the "Do Once". Trigger the custom event at the end of the code after the "Gate" and in-between the set "Is Held" and the "Close" on the Gate.

    • @4rzky536
      @4rzky536 Рік тому

      its working perfectly, but when i move away from the box and closer again the widget is not showing, what should i do, pls 😭

  • @youngjojo3052
    @youngjojo3052 2 роки тому +1

    I swear every time I need something Matt already have it done

  • @CommanderColson
    @CommanderColson 3 роки тому +5

    This is amazing man thank you so much for this tutorial 😭

    • @MattAspland
      @MattAspland  3 роки тому +1

      Thank you massively man, so happy I could help! :)

  • @techyspace5713
    @techyspace5713 3 роки тому +2

    Dude, I love your tutorials, keep it up, like actually

    • @MattAspland
      @MattAspland  3 роки тому +2

      Thank you so much bro, that means a lot to me!

    • @techyspace5713
      @techyspace5713 3 роки тому +1

      @@MattAspland I've been looking for a way to simulate NPCs similar to those from GTA V, like how when you throw a grenade the cars start driving like crazy and things like that, I feel like if you were to make tutorials or a video series teaching similar GTA mechanics that'd make your channel grow a lot my guy

    • @MattAspland
      @MattAspland  3 роки тому +1

      @@techyspace5713 Yeah that sounds like a great idea man, cheers for the suggestions!

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

    Matt, thanks for the tutorial. You always seem to save the day. I have an issue where the remove from parent doesn't seem to be working. I can walk away and the hud is still active. I'll look at it again later when I have time. I'm on a later version but that shouldn't make any difference.

  • @DragonWarpFX
    @DragonWarpFX 3 роки тому

    Love your tutorials!

    • @MattAspland
      @MattAspland  3 роки тому +1

      Thank you so much, I really appreciate it :)

  • @hibye5833
    @hibye5833 2 роки тому +4

    If you're using UE5, be sure to add the Canvas Panel first

  • @ShaunOfTheN00bs
    @ShaunOfTheN00bs 3 роки тому

    This is exactly what I was looking for to code a progress bar for my game, but a question: is there a way to implement non-standard progress bar movements to go with custom UI elements? For example, I want to add a circular progress bar that advances in a clockwise rotation, similar to the lockpicking interaction in Payday 2.

  • @ShouldersofGiantsGames
    @ShouldersofGiantsGames 2 роки тому

    Hey Matt, great tutorial, any assistance with the following would be greatly appreciated!
    Upon filling up the bar I dont want it to fill again untill you release and press E again, at the moment they can continually hold E and fill the bar but it doesnt always fire off the "destroy actor" section or in my case spawning another actor. Either fix to stop untill you press E again or a fix to keep spawning items when bar keeps filling up

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

    Hi @Matt Aspland, first I just wanted to say thank you so much for your tutorials, you are really helping the dream of creating my own survival horror game, a reality.
    I know this is super late, but my progress bar does not fill, everything else works perfectly.
    The bar comes up on screen, but the visual of the bar filling up isn't working.
    Any help or suggestions would be greatly, greatly appreciated. Thank you again for you awesome tutorials Matt.

  • @stevenwynn819
    @stevenwynn819 3 роки тому

    Nice job!

  • @sithmaster
    @sithmaster 3 роки тому

    Hello Matt! First, thanks for this awesome tutorial. While it should work out of the box, I try to use it for a little different case and ran into a big problem. In detail, I just want to have the progress bar on my title screen (similar to games like Cyberpunk with the "Hold a button to start" and the progress bar fills up before any menu gets called. Problem in short: The progress bar won't update.
    My setup:
    - I actually have the progress bar inside a Widget BP that gets called with a Blueprint Interface at begin play inside a main menu controller (player controller)
    - The whole function like seen in your video is build inside this player controller
    Working result:
    - The hold function itself works and in the end I can make the hold button widget destroy and call my character selection screen
    Big Problem:
    - The Bar is not updating. I am searching on tutorials, solutions..event dispatcher things and whatever for a week now and can't make it to work. I tried it inside the level blueprint, player controller, some blueprint actor. Whatever I do, the progress bar is not filling up. I added a lot of print strings to test and when holding a button, the "Max Time Held" fills up from 0 to 1 in a second (float) so at least its doing "something".
    Do you have a clue why the UI does not update the progress bar or would you love to create some little tutorial on how to actually setup systems that don't need any in-level additions or actors but actually just work between the players input and the UI alone? All tutorials I found were either about stamina and health bars or pickup systems that need actors or in-game interactions but none of them tackled things like that.
    Cheers and sorry for the long text.
    Toby

    • @MattAspland
      @MattAspland  3 роки тому +1

      Hi Toby mate, that sounds like a great idea. Yeah it sounds like everything works as it should, everything apart from visually seeing the bar fill up. So my first thought would be to make sure that you are setting the percentage filled in the bar in the widget correctly. I.e. you are doing it, it's in the correct widget, etc. If you want you can send me some screenshots via my email found on my channel's about page. And I can also add this onto my video list; Hold button to start game?
      All the best!
      Matt

    • @sithmaster
      @sithmaster 3 роки тому +1

      I believe I probably messed up when it comes to casting or something else. Actually the widget is being called over an BP Interface, maybe thats a reason. One on Unreal Slackers told it could be that the Event Timer may hold it back from being updated on runtime on the widget. -- Actually the journey to a thing where I personally thought it would be an easy one took about a week to achieve. But from all tutorials.. your's really was the best to have for that. Big kudos to you!
      Cheers!

    • @MattAspland
      @MattAspland  3 роки тому +1

      @@sithmaster Ah right okay, well narrowing down to where the issue starts is always a great step forward in figuring out! Glad that I could help with my tutorials though mate, that's great to hear, glad I could do so. All the best mate, and let me know if there's anything you ever need again! :)

    • @sithmaster
      @sithmaster 3 роки тому +1

      @@MattAspland Thank you so much! As a pure Senior Environment Artist with very little knowledge about coding, your knowledge and your videos are saving my day since I try to kick-off a vertical slice on my own - which hopefully becomes a bigger official project where real code-magicians will hopefully kill my current "Blueprints From Hell"..

    • @MattAspland
      @MattAspland  3 роки тому

      @@sithmaster No problem at all mate, it's always a pleasure to help out. I know what it's like trying to make a vertical slice, and even a full game, on your own, so any time I can help out, just let me know! I wish you all the best man, good luck with this vertical slice, I'm sure it will be great and you'll get some programmers intrigued and joining!

  • @MorganFuse
    @MorganFuse 3 роки тому

    Fantastic !

  • @davidfattore
    @davidfattore 3 роки тому

    Hey Matt, this is amazing, exactly what I've been looking for fundamentally, I noticed @HoneyHive's comment and I can't say that I've played Day' Gone, so my request may be similar, but is there a way of making the progress bar a square shape or a circle, with the "E" key in the middle and having the progress bar gradually fill itself up clockwise around the key?

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

      I have thought exactly the same, binding it to the animation. Have you done it?

  • @blendersovann5123
    @blendersovann5123 3 роки тому +1

    Amazing

  • @KillerSneak
    @KillerSneak 2 роки тому +1

    How would this work with replication? (as this setup won't work and will show the interact widget on both server and client)

  • @ThriveOSRS
    @ThriveOSRS 3 роки тому

    Hi matt ive tried adding this to a character blueprint class as a pickpocket system on the back of an ai instead of an actor class and this doesnt seem to work, i was wondering if you have any idea why this is?

  • @keremius5201
    @keremius5201 3 роки тому

    AWESOME : D

  • @Grand-warden
    @Grand-warden 3 роки тому

    Thanks 😊

  • @vladaslav
    @vladaslav 3 роки тому

    Welldone man, can this also be implemented as a "Press A Repeatedly" mechanic?

    • @MattAspland
      @MattAspland  3 роки тому +2

      Thanks man, and absolutely! I may also do one for specifically that too

    • @vladaslav
      @vladaslav 3 роки тому

      @@MattAspland nice can't wait man 🤘

  • @Zeronity
    @Zeronity 2 роки тому

    Hey! Quick problem around 12:00, when I try to call TimeHeld from the WidgetRef, it doesn't show up in the search. Adding it without "Context Sensitive" selected make it say it's not compatible. Any ideas on how I could fix this?

  • @crimsontyrs
    @crimsontyrs 3 роки тому +2

    Hey Matt this worked really well except that after I pick the item up the progress bar and the text doesn't disappear? Even after I have moved out of the box's region. Thoughts? On further examination, it has something to do with how close I am to the item. It works fine if I am farther away from it.

    • @Shirotsune-Tomuro
      @Shirotsune-Tomuro 3 роки тому +2

      if you slap a do once before the widget creation on your bp and then have it reset after the widget is destroyed, it'll solve your problem

  • @mateuszsieczka7989
    @mateuszsieczka7989 3 роки тому

    Hey! Good tutorial, but I was wondering how could You make progress bar fill smoothly, if You know what I mean. I'd love to see tutorial for that!

    • @MattAspland
      @MattAspland  3 роки тому +1

      Hey, to increase it more smoothly you'd essentially want to increase the values by a smaller amount. I can maybe look into alternatives too :)

    • @mateuszsieczka7989
      @mateuszsieczka7989 3 роки тому +1

      @@MattAspland Yup, that's one idea, but I think You have to do something else to make it really smooth.

    • @MattAspland
      @MattAspland  3 роки тому +1

      @@mateuszsieczka7989 Yeah I think there is as well, I believe I've done it before so I'll keep looking into it more :)

  • @canokan_
    @canokan_ 3 роки тому +1

    nice

  • @Alex00m
    @Alex00m 3 роки тому

    Cool bro 😌👍

  • @milunon2887
    @milunon2887 3 роки тому +1

    Is it possible to not reset the timer and keep the last known time ?

  • @mohamedkhalid9996
    @mohamedkhalid9996 3 роки тому +3

    great tut thank you so much but there's a bug when you are holding E and go away from the collision the event still going on
    edit: for people having the same bug you have to set IsHeld? variable to false after removing the widget for parent

    • @user-ul5gh1dt7t
      @user-ul5gh1dt7t 10 місяців тому

      Thank you Thank you Thank you very much!!

  • @abdullahsohail5395
    @abdullahsohail5395 3 роки тому

    Nice video

  • @avrahamrosenberg2905
    @avrahamrosenberg2905 4 місяці тому

    hey i want it that when u let go of the button and start again it will start from where u left of i managed to make it destroy the object but the ui always restarts help will be much appreciated

  • @mihajlodjordjevic3292
    @mihajlodjordjevic3292 3 роки тому +1

    Hey @Matt Aspland i have an issue 12:00 if i try to put widget ref to target self on set timeheld variable it says it is not compatible?
    Edit:I Fixed it the issue was widget ref was on User widget blueprint and it needts to be on hold widget

    • @MattAspland
      @MattAspland  3 роки тому

      Hey, glad to hear you fixed it, sorry for my delayed reply. Thanks for leaving your fix for others to see too :)

  • @iiior605
    @iiior605 3 роки тому

    bro, could you show how to make a destination point appear on the screen at a specific location
    (as in cyberpunk for example)

    • @MattAspland
      @MattAspland  3 роки тому

      Hey man, I could definitely look into that one yeah!

    • @iiior605
      @iiior605 3 роки тому

      @@MattAspland wohoo🤩👌

  • @thorlightning1249
    @thorlightning1249 3 роки тому +1

    Do you mind if you can just do: On-screen text when near a character. So when I come up to a character it will say Press Enter To Switch. You click enter then you switch and it takes one second like you did for your first one in 14:45. Without the bar, just the text Can you pls do that?

    • @MattAspland
      @MattAspland  3 роки тому +1

      Hey, you can do this exact same process I did with creating the widget on begin and end overlap. I responded to your comment before about this, maybe you didn't get notified. I have a video on a widget appearing and disappearing from your screen based on your proximity to something, and one on changing characters. Hope it helps :)
      On Screen Prompt: ua-cam.com/video/Os7uf-wiU8o/v-deo.html
      Changing Characters: ua-cam.com/video/GAlBfDtTcYE/v-deo.html

  • @emilweinbergjensen3565
    @emilweinbergjensen3565 4 місяці тому

    Is it possible to make it so it appears in the world and not sticks to the screen

  • @eddr6124
    @eddr6124 Місяць тому

    this mf explains so well😭

  • @aliahmedgaming6083
    @aliahmedgaming6083 3 роки тому +1

    How to make inventory system in unreal engine 4 Two objects Please

    • @MattAspland
      @MattAspland  3 роки тому

      Hey like I've said, I've added it onto my list :)

  • @coffeediction
    @coffeediction 2 роки тому

    Why MaxTimeHeld?
    Isnt it JUST TimeHeld

  • @sriram7286
    @sriram7286 3 роки тому

    Can we get a decent performance of unreal engine in 8gb ram in pc

    • @MattAspland
      @MattAspland  3 роки тому

      Hey, you can definitely get decent performance. I started with 8gb and only found an issue with it when I started to build the games of larger maps. But yeah 8gb is definitely good enough.

  • @CommanderColson
    @CommanderColson 3 роки тому +1

    I'm having an issue where the timer seemingly doesn't stop after I activate the hold mechanic (the action is a mesh that moves back and forth every time I hold E) ua-cam.com/video/PMaurpsYprU/v-deo.html
    Help?

  • @supermariogolden6444
    @supermariogolden6444 2 роки тому +1

    When I walk away the widget still stays on my screen

  • @user-yb2ec5rr4c
    @user-yb2ec5rr4c 3 роки тому

    Remove from parent not working for me how fix?

    • @MattAspland
      @MattAspland  3 роки тому

      Hey, make sure that it is connected properly I.e. the target is in our widget reference or the create widget. Also, make sure it is off of "End Overlap". Keep me updated :)

  • @furrybproductions
    @furrybproductions 3 роки тому

    HA! Where was THIS a few months ago!? 😂😂😂

    • @MattAspland
      @MattAspland  3 роки тому

      Haha, sometimes stuff it too late unfortunately lol