How to turn ON & OFF Lights with a Blueprint in Unreal Engine 5

Поділитися
Вставка
  • Опубліковано 9 лют 2025
  • Environment Blueprint Basics: • How to Create a Bluepr...
    Join this channel to get access to perks:
    / @peytonvarney
    In this video we take it a step further with our blueprint actor streetlights and I cover how we can set them up to be controlled by a keyboard input. The specific streetlights are more difficult because they require not just the light to be toggled but also multiple material changes to get the look correct!
    Hope you found this helpful and let me know down below if you have any questions or things you would like to see covered in a future video!

КОМЕНТАРІ • 24

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

    Awesome job breaking down how to do this, Peyton! Really makes for some cool narrative opportunities with level design and great to see how you work within the blueprints! Excellent work!

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

    Thank you for doing this. I spent the last 6 hours looking for a Unreal Engine tutorial that would show me how to find if a key was pressed. I spent 9 years being a Unity Developer and I finally decided to try Unreal Engine. Thank you Peyton Varney, I was so close to uninstalling unreal engine and going back to Unity3D.

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

      Glad it helped you and kept you from giving up on the engine. I love a lot of what the engine has to offer and of course it is difficult sometimes to find what you need but hope you enjoy using it. let me know if theres anything else youd like covered as well!

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

    Hi Peyton. Great video. I was wondering, is there a way to press F to turn on and off lights, but also have a button in a widget that does the same thing? I can't seem to figure it out beyond creating the OnClicked Button in the Widget :(

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

    Hey Peyton, thanks for the video. I'm trying to use this method to turn on lights on a vehicle -- the lights start on the vehicle, I can turn them off, but can't seem to turn them off. To turn them off I'm calling the 'Set Material' and using the Element Index for the 'On' lights -- and for the 'Out 1' setting of the MultiGate I'm calling the 'Of' light texture (that actually doesn't start on the mesh). But I have a feeling, it doesn't actually swap the material, more so enable/disable it - so when I try turn them on, it does not have any of the 'Element Index' to look up.

  • @Icsir01234
    @Icsir01234 10 місяців тому +1

    Hey man!
    How did you do the fog so the light is visible all the time and not only when it hits a surface? Could you help me? :D

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

    Is there a way to make a delay on the lights so they turn on in a sequence? For example, a warehouse with 20 lights and when you push the button the first light turns on, and then the second, and then the third and so on - is there a way to achieve this with blueprints in ue5?

    • @R-SXX
      @R-SXX Рік тому +1

      I am not the best with blueprints, but on a whim I would say to stack the lights with a delay. One light, then a delay with a new light and so on.

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

      Sure, use the delay node and set the time delay to whatever you prefer. Out of curiosity I did something like this a while ago where the player enters a collision sphere/box that then blows out the light by setting the light's visibility (or alternatively the intensity) to off, then, after a short delay, the lights go back on, another short delay to make them go out again, and so on to create the flickering and at a certain point in time just set visibility/intensity to on and that's it.
      Or, you can also create yourself a "flickering material" which is applied to the lights once for as long as the flickering should occur and then, when you don't want any flickering anymore, change the material on the lights back again to have a non-flickering light.

  • @MCMishaNoernir
    @MCMishaNoernir 2 місяці тому +1

    can you make a tutorial on how to make this with an interactable switch?

    • @PeytonVarney
      @PeytonVarney  7 днів тому

      yea, I can look into doing a switch tutorial shortly. Streetlights might not make sense but ill see about making something fun for it!

  • @mjzcreations8571
    @mjzcreations8571 6 місяців тому +1

    May I know how you made the lights have that triangular shine on the streets without scattering everywhere? been trying to do that with point light in UE 5.

    • @PeytonVarney
      @PeytonVarney  5 місяців тому +1

      Spotlight will be a much better starting point for you. Point lights dont have directionality by default and will go outwards in all directions. Spotlight will already have the direction implemented!

    • @mjzcreations8571
      @mjzcreations8571 5 місяців тому

      @@PeytonVarney Much Thanks☺

  • @J4FThunder666
    @J4FThunder666 5 місяців тому +1

    Nice ! But how i can save/use the Lamppool and the Light for example a procedural City ???

    • @PeytonVarney
      @PeytonVarney  5 місяців тому

      In what way? If you mean you are creating your city procedurally then it would have to be implemented into the same sort of technique that you are using to actually build out your city as well

    • @J4FThunder666
      @J4FThunder666 5 місяців тому

      @@PeytonVarney Thanks !

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

    👏👏👏

  • @ones1ghtproductions18
    @ones1ghtproductions18 2 місяці тому +2

    Don’t use visibility for lights it still runs in the background, instead use intensity

    • @PeytonVarney
      @PeytonVarney  2 місяці тому

      Solid tip, will keep this in mind for the future, appreciate it!

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

    I did not recommend putting it all on tick. This will become a costly action, it is better to switch to the interface or the dispatcher

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

      Appreciate the insight, will try to switch it over if I expand upon this further!

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

      I was about to mention the same thing haha because checking for "if pressed" on EVERY tick is actually costly.

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

    It Does work but not in a build or Standalone Game.