Laser beams in Godot 3.2 (using a RayCast2D)

Laser beams in Godot 3.2 (using a RayCast2D)

Heartbeast

4 года назад

32,241 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@tjwinn4931
@tjwinn4931 - 07.03.2020 08:01

Pogchamp

Ответить
@adamsmiddy
@adamsmiddy - 07.03.2020 08:44

"Good morning, afternoo-" presses like cause HeartBeast

Ответить
@TimmyBobimmy
@TimmyBobimmy - 07.03.2020 09:41

Hey dude your content is super awesome, and you inspired me to stick with the Godot engine when I was about to uninstall it, and now I love using it to make games. Keep up the great content. Thanks.

Ответить
@TackerTacker
@TackerTacker - 07.03.2020 09:46

Great tutorial. I think you should post your videos on the Godot discord, they have a channel for sharing tutorials.

Ответить
@veltsu9
@veltsu9 - 07.03.2020 13:32

That is very handy! +1
Now I wonder how would a laser beam work, which gets reflected from the walls...?

Ответить
@Ric_93
@Ric_93 - 07.03.2020 13:47

I needed this! Thank you so much Benjamin!!

Ответить
@Archive-w5s
@Archive-w5s - 07.03.2020 14:15

the like/dislike ratio tho ....

Ответить
@mahmoud.zayedd
@mahmoud.zayedd - 07.03.2020 15:08

Hope do the same in Game maker 💙

Ответить
@mazimadu
@mazimadu - 07.03.2020 15:50

Looks like you have been making good progress using Godot.
How do you feel it fairs compared to GameMaker studio 2?

Ответить
@stevenjadamo
@stevenjadamo - 07.03.2020 17:54

Definitely filing this one aware for future use... thanks Ben!

Ответить
@nabilandadamslaboratory3422
@nabilandadamslaboratory3422 - 07.03.2020 17:58

Please keep with the Godot videos! Gamemaker is outclassed now.

Ответить
@jinshiro
@jinshiro - 07.03.2020 18:33

Planned to add mining lasers to my game today, perfect timing. Now I have a reference for implementation.

Ответить
@Aahaah8
@Aahaah8 - 07.03.2020 19:43

Thank you so much for this tutorial, this is exactly what I've been looking for! So simply explained, you are awesome!

Ответить
@davidphillips9366
@davidphillips9366 - 07.03.2020 20:01

Thanks for such great tutorials! I've always been interested in game development but I had never tried it until I started watching your videos. Im so glad you take the time to explain why things work the way they do and you don't just right a bunch of code and then vaguely explain what it all does.

Ответить
@kennethmkline23
@kennethmkline23 - 07.03.2020 20:52

I really miss your Gamemaker tutorials :)

Ответить
@JimmyCrackorn
@JimmyCrackorn - 07.03.2020 22:12

Will you do a follow-up to go over setting up the beam to reflect off of surfaces when there's a collision and making it respond to input instead of always being on?

Ответить
@AniMesuro
@AniMesuro - 07.03.2020 22:33

Thank you so much. I've been trying to figure out how to make art-heavy backgrounds with polygons, as in Once Upon a Coma, and didn't know how to start. Never thought about stealing CollisionPolygon2D's polygon to Polygon2D from a script.


Didn't expect to learn it from a laserbeam tutorial tho.
Now with this in mind I think I'll try to make a script to fill the border with grass sprites.

Ответить
@seewhale8565
@seewhale8565 - 08.03.2020 00:08

Hi Ben, could you redo the top-down rpg in Godot which you previously did in Gamemaker?

Ответить
@me2beats313
@me2beats313 - 08.03.2020 00:40

Cool:)

Ответить
@godonholiday
@godonholiday - 08.03.2020 01:31

Quality

Ответить
@vigneshs2886
@vigneshs2886 - 08.03.2020 10:05

Good lord I was literally searching for this yesterday and I couldn't find it. It seems like you made this video just for me lol. Thanks a lot.

Ответить
@NidonocuPoisonBunny
@NidonocuPoisonBunny - 08.03.2020 11:54

Can I ask how Godot is configured to remove 3D related things?

Ответить
@Gost-nf3cr
@Gost-nf3cr - 08.03.2020 14:52

do you can make a download of all your tutorial projekts that would be very nice

Ответить
@michaelcapone175
@michaelcapone175 - 09.03.2020 16:06

Great tutorial Ben. Taught me something. Thank you.

Ответить
@RDHardy79
@RDHardy79 - 10.03.2020 09:50

For me, and I followed absolutely ever single step twice (I started all over again the first time this problem happened) but every time I try to run the game from the world scene with the collision objects in place, the laser doesn't track the mouse. Tracks it just fine in the laser scene but not in the world scene.


The error :
Line 9 (UNUSED_ARGUMENT):The argument 'delta' is never used in the function '_physics_process'. If this is intended, prefix it with an underscore: (ignore) '_delta'




The debugger states: Invalid call. Nonexistent function 'get_Collision_point' in base 'RayCast2D.


Mind you, the code is identical what gives?


Okay so, I figured it out as I was composing this. I'm keeping this comment to maybe help others. 'get_Collision_point' is invalid due to the simple fact that there is no such thing as get_Collision_point in GDOT, there is a get_collision_point.SEE IT?? I had Collision capitalized and thus the whole code was bunk. that is stupid as hell, but oh well. I'm learning. Thanks for the videos.

Ответить
@Joshua-kr5fq
@Joshua-kr5fq - 10.03.2020 16:20

when will you be doing networking?

Ответить
@KlausWulfenbach
@KlausWulfenbach - 10.03.2020 18:04

Time to add a laser weapon to my Metroidvania game!

Ответить
@IndieLibre
@IndieLibre - 23.04.2020 17:45

Muchas gracias!

Ответить
@ZetaCarinae
@ZetaCarinae - 12.05.2020 07:11

Super helpful thank you!

Ответить
@jackwinner4810
@jackwinner4810 - 14.05.2020 01:41

Hello Mr. HeartBeast thank you very much for your Tutorial. I don't
I don't undestand english but I understand all that you did.
You inspirate me to do VideoGames
Thank you very much and God Bless you and your family!!!!

Ответить
@kylin3197
@kylin3197 - 05.06.2020 01:24

very cool! awesome vid!

Ответить
@DrNabeel20
@DrNabeel20 - 27.06.2020 16:03

Thank you this is amazing! 💯💯

Ответить
@25w-g6c
@25w-g6c - 19.07.2020 13:44

Thank you so much for this

Ответить
@CAl_9000
@CAl_9000 - 25.07.2020 21:38

Curiously this doesnt work when instanced as a child of my player character but works fine when instanced directly in the world

Ответить
@cristianinujazznight3044
@cristianinujazznight3044 - 26.07.2020 05:51

Thank you for the video.

Ответить
@antonioedmilson1810
@antonioedmilson1810 - 26.07.2020 05:53

Thank you so much!

Ответить
@antonioedmilson1810
@antonioedmilson1810 - 26.07.2020 20:04

You can helpe me? My laser have a Collision Polygon2D, and i want to that Polygon2D too extends to the collision point of raycast, same of sprite. Can you helpe please?
love your videos <3

Ответить
@MM-ym8kk
@MM-ym8kk - 19.08.2020 21:37

why multiplying by MAXLENGHT if you going to use normalized() will it not be scaled to 1

var max_cast_to = mouse_postion.normalized() * MAX_LENGHT

Ответить
@ghb323
@ghb323 - 22.12.2020 01:56

Not to be confused as a short laser projectile that travels A LOT slower.

Ответить
@ivanzelta3609
@ivanzelta3609 - 14.01.2021 01:36

I LOVE THIS GUY

Ответить
@tomf4927
@tomf4927 - 21.01.2021 23:15

Thanks for this! However, I discovered a little problem. The raycast stops while the beam image continues to extend itself if it isn't colliding. I solved this by altering the if/else statements. if colliding: beam.region_rect.end.x = end.position.length(), else: beam.region_rect.end.x = end.global_position.length()

Ответить
@BottleBlondage
@BottleBlondage - 03.03.2021 11:37

I have a problem. none of the recommended fixes stop it. the raycast doesn't collide with the walls and the endpoint never moves more than 100 pixels away. Thanks!

okay, so I kinda fixed it. it still extends the beam too far but the endpoint is in the right spot. apparently, putting it on a moving sprite doesn't work very well.

okay, so I fixed the problem with the sprite, turns out it was colliding with its hitbox. I still cant fix the problem with the beam though.

also, how do I turn the beam on and off?

Ответить
@pompyproductions5644
@pompyproductions5644 - 18.06.2021 01:07

~wherever and whenever you are, my name is Benjamin~ here have a like

Ответить
@CamiloS2001
@CamiloS2001 - 23.02.2022 20:17

thank you

Ответить
@covereye5731
@covereye5731 - 28.01.2023 15:46

Not sure how you would use region rect that way if you were pulling the beam from a spritesheet.

Ответить
@mertgulec7541
@mertgulec7541 - 31.01.2024 18:28

Still useful. I am glad this tutorial exists because all other are just copy paste and no explanation

Ответить
@RedEyedJedi
@RedEyedJedi - 27.02.2024 18:13

This isn't just a great tutorial. it's also a great lesson on how to program. First, know exactly what you want to achieve. Secondly, divide that problem into many smaller problems and then start solving these smaller problems until you have completed the bigger problem. Thank you for the video. It was very helpful.

Ответить
@th-bl7fd
@th-bl7fd - 14.03.2024 09:51

Thank you.

Ответить
@braveblade87
@braveblade87 - 14.03.2024 17:38

In GODOT 4.0 RayCast's cast_to was renamed to target_position

Ответить