Unreal Engine 5 | Lasers Tutorial Part #1

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ค. 2023
  • A tutorial on how to create a laser system you would see in games like portal. In this part we will create the laser, the spawn and a target.
    The final result will resemble the following video:
    • Unreal Engine 5 | Lase...
    Playlist :
    • Unreal Engine 5 | Lase...
  • เกม

ความคิดเห็น • 26

  • @Pyrodactyl
    @Pyrodactyl 4 วันที่ผ่านมา +1

    Really well explained and at a good pace, great video! :D

    • @patsanoob8923
      @patsanoob8923  3 วันที่ผ่านมา

      Glad you like the video!

  • @gatOlegat
    @gatOlegat 2 หลายเดือนก่อน +1

    Great tutorial, good explanation along the way, you earned a like and a subscriber!

  • @user-zu2ie1kn5u
    @user-zu2ie1kn5u ปีที่แล้ว +1

    Thank you Bro

  • @juliusvogt3794
    @juliusvogt3794 7 หลายเดือนก่อน +1

    Great video :) I have a question. I parented the cone to a moving object, the problem i have is that the laser beam doesnt move with the cone. Only when play in simulation mode the "A_Laser" appears in the world outliner and i can parent it to the cone. Is there a way to parent the beam to the cone before it appears?

    • @patsanoob8923
      @patsanoob8923  7 หลายเดือนก่อน +2

      In the second video of the tutorial, you will setup a cube that you can move around and it will have to attach the newly spawned laser to it, you should be able to use the same trick for what you want. The node you are looking for is Attach Actor to Actor.

  • @sphynx_owner8224
    @sphynx_owner8224 ปีที่แล้ว +2

    10:40 the narration loses synch for a bit with whats happening on screen and i found it to be confusing a bit. you got on track right after so not the worst. overall this tutorial is very thorough and thought out. you explain things clearly and the blueprints are very organized and coherent. for a first tutorial this is very impressive.
    other few notes i have for you:
    1. the narration is a bit too quiet.
    2. a background music is not necessary, but would elevate the overall vibe if done correctly.
    3. a more coherent thumbnail from upclose on the lazer could attract much more. the effects you are showing of it bouncing and stuff in the video would look great in the thumbnail.
    4. you should consider using instanced static meshes. you would have one parent mesh per lazer actor, and this way you could have hundreds of bounces without losing performance. its a bit trickier, and definitely not necessary.
    5. i would like to see you pull off some effects for the impact points of the lazer with walls and objects. like sparks flying out or some heat ripples around the impact point, as well as some propper sound effects for events of updates in collision of the laser, say the laser just impacted something new. or have some constant humm near the base of the lazer to indicate the energy being put into it. throw in some variation to the emmission level to show it pulsating and vibrating and make it feel more real. this is a lot to do but these are all just ideas for you. even having a bit of it would go a long way. you could implement decals where the lazer last hit, to show the spot glowing with heat afterwards... could be very cool.
    i have not made any tutorials but i watched many, and i know how hard they can be to make. so all of this is just for you to have. overall i would be very pleased to use this tutorial if i ever looked to make a lazer for my game so good job. cant wait for the next upload.

    • @Yaeko275
      @Yaeko275 ปีที่แล้ว

      Regarding:
      4: He doesnt need instancing as long as he isnt using non-opague materials on the meshes, and has Nanite enabled.
      That said, from what I see, his approach will be a real troublemaker once it gets to color-mixing, updating, (infinite)loops etc.

    • @patsanoob8923
      @patsanoob8923  ปีที่แล้ว

      I imagine you are referring to the approach of enabling and disabling the targets hit by the lasers? If so yeah, the second part completely removes all of that because it did cause a few issues and would not work when adding new lasers.
      If that's not it, would you mind telling me what you are referring to and explaining why, so I can learn where my mistake is. Thanks!

    • @Yaeko275
      @Yaeko275 ปีที่แล้ว

      @@patsanoob8923 I dont think you made a "mistake", I am just curious how you would want to do this in a game where the lasers can change colors mid-frame because the player mixes R+G for example. (or unmix something etc.)
      I have something similar, but its quite a bit more complex due to additional features for players, that are needed because players "break stuff" - infinite loops of tools that invert colors, reflectors that let a certain color pass through but reflect the other etc.
      I also (instead of putting the logic into the actors) centralized the whole laser-stuff, but even then, there was quite a bit of data to be thrown around, to meet all requirements.

    • @patsanoob8923
      @patsanoob8923  ปีที่แล้ว

      That's actually a really interesting mechanic, I might have a go at it to see if I could make it function with this system. Thanks for the response.
      (love the look of ReThink 4 btw)

  • @PraviLukijanJC
    @PraviLukijanJC หลายเดือนก่อน +1

    i was doing everything correctly but some reason the target wont change back to grey from blue. i put a print string at the end and it is working but the texture wont change. Im not sure what is wrong.

    • @patsanoob8923
      @patsanoob8923  หลายเดือนก่อน

      If it is not turning back to grey then I would suggest checking that the Active is getting called as false when it is no longer connected, that is the most likely cause if the print is being called correctly. The reason for it being true is probably because I very quickly change P-Hit response to false on laser bounce and if you miss that it will stay active even if disconnected (20:30) also make sure you change the target to "LastHitActor" otherwise it won't change at all.
      Hope this helps

  • @blackrain4346
    @blackrain4346 หลายเดือนก่อน +1

    I have followed every step to a T when it comes down to this guide and for what ever reason my LaserTarget doesn't want to change colors. I have no idea what Im doing wrong

    • @patsanoob8923
      @patsanoob8923  หลายเดือนก่อน +1

      The most likely error is that you have an extra space bar in the Parameter Name on the Set Vector Parameter Value (13:00). Could also be an extra space on parameter name in the material (11:25)
      If even that isn't solving it, I would suggest adding a print in the Change Color function to check that it is being called.
      If it is being called, then the last thing I can think of, and that is adding the node "set material" in the function Change Color:
      - Make sure the Material is set to the Return Value from Create Dynamic Material Instance.
      - The Target should be set to the SM_Parent
      I hope this helps.

    • @blackrain4346
      @blackrain4346 หลายเดือนก่อน

      Thank you so much!!

  • @stealthgamesaremyjam145
    @stealthgamesaremyjam145 6 หลายเดือนก่อน +2

    At 4:50 when I add SpawnActor from class, neither "Spawn Reference" or "Laser Color" show up.

    • @patsanoob8923
      @patsanoob8923  6 หลายเดือนก่อน +1

      So if a variable is visible on the Spawn Actor from Class, it means that inside of the Actor you are making, in this case A_Laser the variable is set as Instance Editable & Exposed on Spawn. If those two boxes aren't checked, then it won't be visible (if after checking them and compiling, it still isn't visible, you can right-click on the node a press Refresh). It should be setup like at 1:50. This should solve your issue.

    • @couture1054
      @couture1054 2 หลายเดือนก่อน +1

      @@patsanoob8923 I had the same problem, thanks for the clarification!

  • @FluffyPuppyKasey
    @FluffyPuppyKasey 5 หลายเดือนก่อน +1

    Having everything set up the way you do, I get nothing. No lasers, and no hits. That shouldn't happen because there's objects and walls in the way. I had to change the addition of the actor up vector * 2 and get actor location to a multiplication for anything to happen, but that doesn't work either, since it just defaults to L-Range

    • @patsanoob8923
      @patsanoob8923  5 หลายเดือนก่อน

      Sorry for taking a while to get back to you. So you are having an issue with the line trace then, have you tried changing the debug to see if the line trace is going in the right direction/ even appearing at all. Normally the Actor Up Vector * 2 is ONLY for the start to avoid hitting the actor itself, the actual range is done with the local variable L-Range * the Actor Up Vector, I believe that is where your issue lies (8:26). I hope this solves your issue.

  • @komati7046
    @komati7046 5 หลายเดือนก่อน

    At 13:48, I don't know if I missed something, but my laser just goes through objects

    • @patsanoob8923
      @patsanoob8923  5 หลายเดือนก่อน

      The only thing that could be causing that kind of issue is the BoxTraceByChannel (7:10) normally it is used to determine how long the laser should be, you can check if it is hitting objects by changing the DebugType to Duration. Normally, you should see a red square when it hits.
      If the hit is working correctly, then the issue lies in the Set WorldScale3D (9:54). It could be that you used Initial Overlap and NOT Blocking Hit.
      Hope this helps

    • @BudBot-wz6bg
      @BudBot-wz6bg 3 หลายเดือนก่อน

      @@patsanoob8923I followed what you said and when I changed debug type to duration I get a weird red collum, which I'm assuming means it hit, I'm using blocking hit for the break hit result yet my laser is still going through objects, any ideas?

  • @kristopherfante97
    @kristopherfante97 8 หลายเดือนก่อน

    I am having an issue with my laser consistently making new lasers so it just makes my actors climb and causing lag to mine. any way to fix this.

    • @patsanoob8923
      @patsanoob8923  7 หลายเดือนก่อน

      Are you sure you added all of the nodes to the BeginPlay and not the EventTick because it should only be called once no matter what happens