UE4 Laser System that Reflects Light with Sensor and Mirrors in Unreal Engine 4 Tutorial How To

Поділитися
Вставка
  • Опубліковано 25 чер 2024
  • In this free step by step Unreal Engine 4 tutorial video (UE4 how to) you will learn how to make a laser system that reflects light with emitter, sensor and mirrors using blueprints.
    All my UE4 tutorials: • UE4 Make Rope Swing - ...
    Download Light Bulb asset: drive.google.com/file/d/1IlZG...
    Join me for Live Streams: / lusiogenic
    I Share stuff here: / lusiogenic
    #ue4 #unrealengine #gamedev
  • Наука та технологія

КОМЕНТАРІ • 122

  • @Lusiogenic
    @Lusiogenic  3 роки тому +4

    Download file for the Light Bulb asset can be found in the description.

  • @DusanFajler
    @DusanFajler 5 років тому +1

    Awesome work man!
    I only watched few videos but this is some quality content! Keep it up!

  • @colinericburriss
    @colinericburriss 5 років тому +1

    Your tutorials are amazing!, And most fun.

  • @emilsnall4977
    @emilsnall4977 4 роки тому

    Very cool and easy to follow!

  • @BartalamBane
    @BartalamBane 5 років тому +7

    Классные уроки) Спасибо 👍

  • @hossamnoweser9652
    @hossamnoweser9652 4 роки тому

    thank you for sharing this lovely tutorial

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

    Funny I came here to see how you did your laser system after I implemented mine, and you did it the exact same way, while loop when tracing and also using meshes where most of the people use particles (which looks worse imo). Now I gotta optimize my system :)

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

    This is great! Thanks so much!

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

    Nice tutorial. Loved it. I learned a lot of things.
    At first I thought what am I missing? You can move the cube around. Then I started using Simulate and not run. This worked.
    Then I saw your other tutorial on how to pick up an object. I'll be watching that next.
    The reason why it didn't work at 22:00 is because the type of AffectedActors should have been I_Use, because that's the interface you added to the light bulb.

  • @rendermanpro
    @rendermanpro 4 роки тому

    It is so amazing! Thanks a lot

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

    thx for the lazer system :)

  • @olegsm3118
    @olegsm3118 5 років тому

    really nice, man)

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

    If you have the infinite loop error, just add the reflection counter. Create two float variables, name them for example "Max Number Of Reflections" and "Current Reflection Number". The first thing you do in "Cast Light" function would be setting "Current Reflection Number" to zero. Then in the While Loop condition, you will add boolean AND and connect to it "Current Reflection Number"

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

      Maybe I'm not doing it right, but this isn't working for me. :( The condition seems to always be coming back false so the while loop doesn't even run.

  • @alonshamash9343
    @alonshamash9343 3 години тому

    Amazing tutorial and still relavent to 5.4

  • @Phoenix_VR
    @Phoenix_VR 4 роки тому

    1st, amazing tutorials sir.
    2ndly, I am searching and searching for some solutions to simulate Radar waves in UE and can't find any....would u be kind make a tutorial about it?
    I am thinking maybe exchange the arrow shape to a cone shape for example?!!

  • @unrealengineruseng9583
    @unrealengineruseng9583 4 роки тому

    Cool !)

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

    am i missing something? where are you pulling the materials like the mirror and light sensor from? is there a separate video somewhere or are we supposed to make them ourselves?

  • @raivo4716
    @raivo4716 9 місяців тому

    Nice channel. Thanks. My sensor cube collision doesn't ignore the laser even when I checked the light to be ignored. I duplicated the emitter where it works, but straight away the duplicated sensor glass cube won't ignore the laser. The laser light ignore seems to work only once.

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

    Great video, man 💯
    I try create Object to reflection the Light. But, the light always "False" when the Light hit the Object?

  • @jannovos716
    @jannovos716 4 роки тому +4

    How to remove the green and red lines?
    In the LineTraceByChannel, change Draw Debug Type to 'None'

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

    Hey, unsure if you are still replying to these but I'm having a few issues in getting the light to activate when hitting the Sensor. I know its been a while since you recorded but for some reason, it wont light up. Was there anything specific I was supposed to do on the lightbulb end that I didnt? I saw there was some extra nodes you didnt show midway.

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

    3:20 don't use delay instead go to class defaults and set the tick interval to be 0.01

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

      Thanks, didn't know about that.
      Are there any advantages for using that method?

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

      ​@@Lusiogenic Reducing the tick interval is always good, also shifting the tick on different actors/Instances can help performance significantly. Imagine you have a 100 actor that tick at the same time, that could be a bottle neck, instead you create a variable(float TickInterval ) that you change for every instance, that way they tick at 0.01,0.02 so it is spread out

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

      @@elfideorubio1308 I agree, shifting ticks is a good idea to smooth out framerate, but reducing the tick interval will consume more resources, usually we would want to do the opposite, when possible.

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

      ​@@Lusiogenic My bad I meant Increasing rather than reducing.

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

    Can you teach how to open a door too bcs i did it but the door is looping and flickering 365 degrees

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

    una duda como se borra la línea de trazado si se quiere un arma para disparar, o es reducir la distancia que tiene
    a doubt how to erase the trace line if you want a weapon to shoot, or is it to reduce the distance you have

  • @thevfxwizard7758
    @thevfxwizard7758 5 років тому +2

    Would there be a way to make a complex material that refracts the laser beam or changes its color? I need this system for a VR game I am making. Thanks in advance!

    • @Lusiogenic
      @Lusiogenic  5 років тому

      Yes. Changing the color is fairly easy, when re-emitting the ray, just put another color.
      The refraction should also be possible, but you just have to take into account the fact that the refracted beam is emitted on the interior of the mesh, so double collision might happen. Just emit two beams in the refraction point and calculate each one of them separately.
      I might make a tutorial on this in the future, but couldn't tell you when.

    • @thevfxwizard7758
      @thevfxwizard7758 5 років тому

      @@Lusiogenic OK thank you!

  • @historie-hradu-zamku-tvrzi
    @historie-hradu-zamku-tvrzi 2 роки тому

    I can´t help myself but am I only one who has problem with framerate adn then also preformance as it is overfilling memory? Running Unreal 4.27.1, is there way to fix this issue? Thankl you.

  • @PraviLukijanJC
    @PraviLukijanJC 22 дні тому +1

    my laser looks blurry but functions correctly, any fix?

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

    I'm at 13:22 rn and my project is rendering the lazer but just after that it stops rendering it send help.

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

    How do you make it so that the line trace goes through the glass? I didn't see a blueprint for that part.

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

      i think that is the visibility set to "light"

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

    Hey, great tutorial, almost everything is working for me. I have a problem where when I look at the laser beam at most angles, it has a weird "flashing" thing to it. It looks like 100s of smaller rays are being drawn on the outside of the main line. I do have the code implemented to destroy and clear the array at the start of the function, just have no idea why this is happening. It also only happens from most angles. If I walk up to the laser, its fine. It only happens when the laser beam blueprint is spawned from the emitter BP. I placed it into the level with the same scale and length, and didnt have any problems. Please help!

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

      same problem, would love the help if anyone encountered this

    • @aviv1982
      @aviv1982 3 роки тому +9

      copied from somewhere else in this comment section of someone who solved this, tried it now and it worked! :
      "Hi, I think this bug occurs because you're spawning your actor with a scale (1.0, 1.0, 1.0) and straight after you're scaling it to (0.05, 0.05, whatever the length)..
      I managed to remove the weird visual thing by hiding the actor after spawning it and unhide it after the set Ends function!! :) Hope this helps"
      so basically in the laserOmmiter BP change to this : Spawn actor laser beam -> set actor hidden in game (true) - > set ends - > set actor hidden in game(false) -> add to 'Beams' array

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

      @@aviv1982 As soon as I get back to my PC to test this, ill reply, but this seems like ue4 normal weirdness. Thank you so much for finding this and coming back to this comment!

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

      @@ethandoesguitar1019 sure! Hopefully it works for you as well- just random question- do you have the bug where after an hour or so in the engine the sub-menus start to disappear? Like when in a BP and trying to find a node and the menu disappears for example. Annoys the hell out of me, and I'm on the latest version

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

      @@aviv1982 I thought that bug was just me! It seems to happen when the system has been under a decent load and got to a certain temperature, its super weird, and yep, never happened on older versions, hopefully ue5 will fix all of this

  • @Yakirgar
    @Yakirgar 5 років тому +1

    Hi, I have watched the entire video and then decided to do it by myself. I got to about 8 minutes mark when I have noticed that from some reason my beam goes up in 45 degrees instead of following the arrow. I have tried different things, watched and done step by step with the video, and it is still doing the same thing. It is like the beam doesn't want to follow the arrow direction at all. Any ideas?

    • @Lusiogenic
      @Lusiogenic  5 років тому +1

      Are the line traces for the beam working correctly? Make sure that you test that using the debug drawing of the line trace.
      If the line trace is not correct, then you have to make sure that you calculate it correctly. Check the location and rotation of the arrow. Make sure that you use GetWorldLocation, not local. Check also the GetForwardVector for the arrow.
      If the line trace is correct, then the visual representation is the problem. Check the rotation and position of the beam mesh (in my case, it was the cylinder). Also, check the origin point of the beam mesh.

  • @arnaudroncari2468
    @arnaudroncari2468 5 років тому +1

    Hi guys !
    I can't find anymore the "BPI_set_state"... 17:32
    Need help

    • @dimitardimitrov7950
      @dimitardimitrov7950 4 роки тому

      You have to Create it Right click then go to Blueprint then Create Blueprint Interface and simply Copy his add Bool name it what you wont his is 0n/off

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

    A delay on an event tick while it might work, is not the best way to do it, use an event timer with loop

  • @Belicure
    @Belicure 5 років тому +1

    If you still respond to comments, can you PLEASE help? For some reason the laser beam spawns in the middle of the box it’s shooting off of and the middle of what it’s reflecting off of. This leaves it shooting out of the other side of the box although that side doesn’t do anything. The end of the beam doesn’t enough touch the surface. Got any ideas on what I’m doing wrong?

    • @Lusiogenic
      @Lusiogenic  5 років тому +1

      It's hard to give advice without knowing the BP, but pay attention to the spawn coordinates and what their relative parent is.

    • @four2nothin
      @four2nothin 4 роки тому

      For anyone who is having this issue,
      I had this problem too, the fix was going into the laser beam bp, and making sure at the very beginning, from the set end function, make sure you are plugging the begin point into the BOTTOM part of the subtraction node, and the End Point into the TOP of the subtraction node.
      i.e. you are subtracting the begin point FROM the end point.
      At least that was the fix for me :)

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

      If anyone runs into this issue you can find the fix I did here: i.imgur.com/rtYoA83.png
      Basically you can move the start point along the forward vector by half the vector length and that should offset having the location in the middle of the mirror.

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

      @@BassNuke thank you very much, I have been blocking on it for 1 week! Thanks

    • @MrWook87
      @MrWook87 7 місяців тому

      @@BassNuke hey bro ! Thank you so much !!!!!!! I did the same thing, but it didn't work properly, so I thought it was crazy

  • @AnimeRick86
    @AnimeRick86 5 років тому

    How do you get the light intensity to work with the simple light bulb?

    • @Lusiogenic
      @Lusiogenic  5 років тому

      If you look in the Light Bulb Blueprint (video description), you'll see that there's a LightIntensity. You can manipulate that.
      If you want the trigger to send an intensity to the light bulb, pass the intensity through the interface, instead of On/Off information.

    • @AnimeRick86
      @AnimeRick86 5 років тому

      @@Lusiogenic Thanks for the heads up, I did that but it didn't work. Do you think it's because I put a material instance on the light bulb, because that's where the intensity is coming from?

    • @AnimeRick86
      @AnimeRick86 5 років тому

      @@Lusiogenic Actually I just answer my own question lol. Thanks for the tutorial by the way. It was very helpful, and just what I was looking for.

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

      @@Lusiogenic I dont See Light Bulb Blueprint in video description

  • @hiddenkonitsu9909
    @hiddenkonitsu9909 5 років тому

    Thks !
    This tutorial works fine 4.19...
    I have one problem ==> When I run this in thirdperson game mode, the scale of laserbeam is not stable at x and y axis when the player looks around that but the length of z has no problem.
    Any suggestions for this kind of problem?
    Thks again :}

    • @Lusiogenic
      @Lusiogenic  5 років тому +1

      You may be scaling it in world coordinates, which is not what you want. You should be scaling in local coordinates of the beam actor.
      Are you parenting the beam to a component of the third person character? If so check that the component that you're parenting to have the correct scale.
      Also, make sure that you have the correct rotation of the cylinder in the beam actor, otherwise it will scale on the wrong axis.
      Last thing, make sure that the cylinder has the origin on the base, and not in the middle. If the origin is in the middle, it will scale in both direction and you will have to recalculate its position to be in the middle.

    • @mysenj
      @mysenj 5 років тому

      I have this problem as well. Followed your example. It seems to pulse weirdly with every time the even fires (when your delay in the emitter sends the cast beam function. I tried just scaling the laser beam blueprint in editor and i don't get this issue but when the laser is created at runtime on the emitter it has this graphical glistch Hidden Konitsu mentioned. I'm on 4.20.1

    • @Lusiogenic
      @Lusiogenic  5 років тому

      Have you tried what I've mentioned in my last comment? I would be helpful if you made a short video with the problem, it's really hard to make out from your description what the problem is.
      Make sure that you make the trace visible and see if it's valid or if it hits something else before your target object. It might be colliding with the player character, you have to make sure that the player character ignores the Light trace channel.

    • @MrThroughHeart
      @MrThroughHeart 5 років тому +5

      Hi, I think this bug occurs because you're spawning your actor with a scale (1.0, 1.0, 1.0) and straight after you're scaling it to (0.05, 0.05, whatever the length)..
      I managed to remove the weird visual thing by hiding the actor after spawning it and unhide it after the set Ends function!! :) Hope this helps!

    • @davidferrera2927
      @davidferrera2927 5 років тому +1

      @@MrThroughHeart It helped me 4.21.1

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

    Not working at all. If line hits mirror then loop goes to infinite and if it hits something otherthan mirror or nothing then works fine. It doesn't reflect in either case. I followed the same thing.

    • @Lusiogenic
      @Lusiogenic  4 роки тому

      I have checked the setup in the latest version of the engine (4.24), it works as expected.
      Make sure to check the loop condition after the first line trace.

    • @Jfidjsidbfusbzid
      @Jfidjsidbfusbzid 4 роки тому

      Same issue

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

      If you have the infinite loop error, just add the reflection counter. Create two float variables, name them for example "Max Number Of Reflections" and "Current Reflection Number". The first thing you do in "Cast Light" function would be setting "Current Reflection Number" to zero. Then in the While Loop condition, you will add boolean AND and connect to it "Current Reflection Number"

  • @azagwen
    @azagwen 4 роки тому +1

    I can't find "BPI Set State" it doesn't exist in my file
    Please help

    • @liliansitha1
      @liliansitha1 4 роки тому +1

      you have to create the interface

    • @azagwen
      @azagwen 4 роки тому +1

      @@liliansitha1 I figured it out weeks ago, thanks for the reply tho !

    • @Jfidjsidbfusbzid
      @Jfidjsidbfusbzid 4 роки тому

      Could you explain how you did it ?

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

      @@Jfidjsidbfusbzid Right click in your folder in the main window and in "blueprint" there should be a thing named "interface"

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

    Trying to replicate this, and I can't find the light bulb blueprint anywhere, I've tried my best to make it work and I can't. Please help

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

      Please check description I've put the Light Bulb asset there.
      Just copy the contents of the Content folder into your project's Content folder.

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

      @@Lusiogenic Thank you so much man, this helps so much!

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

    my laser isnt showing up at all

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

    And this should be easier and more understandable than programming? Bet you could do this in 100 Lines of code.

    • @Lusiogenic
      @Lusiogenic  3 роки тому +4

      This IS programming, just the visual kind. A lot more easy to understand for beginners then C++.
      Frankly, I can code in C++, but I don't want to be bothered with the complexity that it adds when I'm prototyping.
      Most of the people spend time prototyping, so Blueprint makes more sense.
      I expect that when people go into the later stages of development, it's their duty to optimize the code and pass it in C++ if necessary.

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

      @@Lusiogenic coming from a coding background, I find the visual style more complex. But i agree it's just my personal opinion.

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

    Infinite loop detected. Blueprint: BP_LaserEmitter Function: Branch Call Stack: Show. Why? :(

    • @PraviLukijanJC
      @PraviLukijanJC 23 дні тому

      you made a loop function. i dont know exactly what but just check if you see anything wrong there.

  • @__dINe__
    @__dINe__ 5 років тому

    Portal 2 :p

    • @Lusiogenic
      @Lusiogenic  5 років тому +2

      :) I do plan on making a part two for this tutorial. One feature that I'm thinking of is beam splitter.

  • @TDR18455
    @TDR18455 4 роки тому

    it doesn't work with the newest versions

    • @meemuboi
      @meemuboi 4 роки тому

      im having an issue with infinite loops, its so annoying

  • @misskj4757
    @misskj4757 5 років тому

    like why didn't you include telling us about the light BP

    • @Lusiogenic
      @Lusiogenic  5 років тому

      What light BP, can you be more specific? I will try to make it available if it isn't already.

    • @AnimeRick86
      @AnimeRick86 5 років тому

      @@Lusiogenic I believe she's talking about when you copy the classic light bulb and mention how it has a simple interface but didn't fully explain that process.

    • @AnimeRick86
      @AnimeRick86 5 років тому

      But now I understand what you did.

    • @Lusiogenic
      @Lusiogenic  5 років тому +1

      You are right, I forgot to include the Light bulb blueprint and material. You can now find them both in the video description.

    • @misskj4757
      @misskj4757 5 років тому

      @@Lusiogenic thank you!

  • @yingyingxu161
    @yingyingxu161 4 роки тому

    Why does my light diverge?

    • @aibarulanov929
      @aibarulanov929 4 роки тому

      Hey man , my light as well , have you found a solution ?

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

    wires are horrible, how you even read this?

  • @quantonium8298
    @quantonium8298 5 років тому +1

    4.21 has broken this code. Infinite loop created with exact code. Edit: While loops in 4.21 are broken and will only result in errors.

    • @firimousse3676
      @firimousse3676 5 років тому

      Do you find a answer/solution to this thing?

    • @quantonium8298
      @quantonium8298 5 років тому

      @@firimousse3676 Nope, I fount a post from 2014 about the same issue, so it seams a previous fix has been broken again.

    • @firimousse3676
      @firimousse3676 5 років тому

      @@quantonium8298 fuck :/

    • @Lusiogenic
      @Lusiogenic  5 років тому +1

      I've checked in 4.22, seems to be working fine. Can you check again?

    • @Wathis
      @Wathis 4 роки тому

      Same problem here (4.23.1), I've tried to increase the maximum loop iteration count but still not working :(

  • @Latvian3Dman
    @Latvian3Dman 5 років тому

    Sweet sweet sexy laser beams... :)

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

    Too much. More simple