Тёмный
No video :(

Godot Top-down Shooter Tutorial - Part 3 (Shooting and Bullets) 

jmbiv
Подписаться 10 тыс.
Просмотров 42 тыс.
50% 1

Опубликовано:

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 158   
@jmbiv_dev
@jmbiv_dev 4 года назад
Hey everyone! We now have a community discord you can join to discuss this tutorial or ask any questions you have along the way: discord.gg/e4BxZbe
@ByteChompGames
@ByteChompGames 9 месяцев назад
For Godot 4 users: - func _unhandled_input(event: InputEvent) -> void: is now simplified to func _unhandled_input(event): - export (PackedScene) var Bullet is now @export var Bullet :PackedScene - Position2D is now Marker2D - onready is now @onready Also if you haven't solved your blurry textures yet, you need to go into the Sprite2D Inspector. Under the Texture tab charge Filter from Inherit to Nearest.
@ericdavis55
@ericdavis55 9 месяцев назад
Thank you!
@sandales
@sandales 9 месяцев назад
ty bro
@jmbiv_dev
@jmbiv_dev 8 месяцев назад
Thanks for leaving these Godot 4 updates! I appreciate it and I know that people still trying to follow this series do as well.
@ByteChompGames
@ByteChompGames 8 месяцев назад
@@jmbiv_dev Thanks for the great tutorial series, I've learned a lot! As I've gotten deeper in the series the less I've run into these syntax issues so hopefully these help people keep going through the series 👍
@PerfectAudioScape
@PerfectAudioScape 8 месяцев назад
I'm using 4.2, instance() becomes instantiate(), feel free to take this into your comment @ByteChompGames , besides that, your comment saved me a bunch of time! Thanks
@arumya9456
@arumya9456 10 месяцев назад
私は日本人ですが、貴方の解説が非常に丁寧なため翻訳字幕でこのチュートリアルを完了できました。 jmbiv殿、ありがとうございます。 I'm Japanese, but your explanation was so thorough that I was able to complete this tutorial with translated subtitles. Thank you, jmbiv.
@jmbiv_dev
@jmbiv_dev 8 месяцев назад
That's awesome! I'm so glad to hear, and glad the series could be helpful.
@OllieboyOA
@OllieboyOA 2 года назад
Participating in my first Godot Wild Jam at the moment. In preparation I had purchased a course on Udemy to try and learn stuff, but the teaching style and content you go over has been infinitely more useful. Great work!
@jmbiv_dev
@jmbiv_dev 2 года назад
Thanks, so glad it's been helpful!
@themount2021
@themount2021 11 месяцев назад
new syntax @export var bullet: PackedScene
@jmbiv_dev
@jmbiv_dev 8 месяцев назад
Thanks for the Godot 4.x update!
@bjkorb7272
@bjkorb7272 2 года назад
2 years later this is still some good stuff :)
@jmbiv_dev
@jmbiv_dev 2 года назад
Glad to hear it's still helpful, thanks 🙂
@DragonAssassin6
@DragonAssassin6 4 года назад
Thanks so much for the tutorial, been trying to get myself into Godot and this was a perfect find to get me started on making something functional. Can't wait to finish more of your series.
@jmbiv_dev
@jmbiv_dev 4 года назад
Awesome, glad to hear that it's been helpful for you. Thanks for watching!
@hanseldsilva2393
@hanseldsilva2393 3 года назад
The only reason you haven't a lot more subscribers is that you don't upload enough. Super useful tutorial.
@jmbiv_dev
@jmbiv_dev 3 года назад
Thanks, I appreciate it! Glad you find it helpful. Yea, I had to take a break unfortunately over the last month or two since I started grad school this fall. Now that I've gotten into a bit of a routine videos should be coming out more regularly though - new one this Wednesday!
@IlijaIlijic
@IlijaIlijic 4 года назад
This is one of the best tutorials I've ever watched! I subscribed to your channel!
@jmbiv_dev
@jmbiv_dev 4 года назад
Thanks so much for saying that and for subscribing, I really appreciate it!
@jmbiv_dev
@jmbiv_dev 4 года назад
Sorry for some of the weird edits/cuts in this one - video editing software that I use was acting up. Hope you enjoy! Let me know any suggestions or specific things you'd like to cover in future videos.
@Silicontent
@Silicontent 2 года назад
Before finding this tutorial, I was working on a quick shooter test, but couldn't figure out why my instancing wasn't working. At about 12:30, when he showed him dragging the Bullet.tscn into the slot in the Inspector, everything clicked. I will definitely keep watching this series, but this was the biggest "a-ha" moment of my life. Nice video!
@jmbiv_dev
@jmbiv_dev 2 года назад
That's awesome - so glad that this helped it make sense for you.
@EricDaily
@EricDaily 4 года назад
This series is REALLY useful! Thank you
@jmbiv_dev
@jmbiv_dev 4 года назад
Thanks for saying that! So glad to hear that it's been helpful for you.
@stevenjadamo
@stevenjadamo 4 года назад
Love this series and more importantly your approach to teaching the material. Thanks and keep it up! :)
@jmbiv_dev
@jmbiv_dev 4 года назад
Thanks for saying that, it means a lot! Glad this series has been helpful to you and thanks for watching.
@imz3r052
@imz3r052 3 года назад
bruh thanks for existing
@jmbiv_dev
@jmbiv_dev 3 года назад
Ha, no problem! Glad you’re liking the videos.
@TheRealKaiProton
@TheRealKaiProton 2 года назад
Ive never come across that Unhandled input, until your videos, seems really good
@jmbiv_dev
@jmbiv_dev 2 года назад
It's a really helpful function, and important to use because it only captures input that nothing else has handled up to this point (which helps reduce the same input being processed in multiple locations).
@felipefacundes1
@felipefacundes1 Месяц назад
Thank you very much, it worked on my cannon that shoots according to the player's position, with look_at(), Godot 4.2
@hemanths6066
@hemanths6066 Год назад
This is the best. I started learning Godot and I am passionate about game development and this career; this series gave me a boost and really helped me understand the basics. Thanks a lot!!🥰❤
@jmbiv_dev
@jmbiv_dev Год назад
So glad to hear that this series has been helpful!
@realdanielpeach
@realdanielpeach 3 года назад
It was really bugging me we dont get autocomplete for bullet_instance, so I dug into it. The reason is because the editor does not know the type of bullet_instance, so it cannot give us code completion suggestions. To solve this we can either A) give it the Area2D type: var bullet_instance: Area2D = Bullet.instance(), and this will give us suggestions for anything in Area2D like position, rotation, etc. Or B) give our Bullet a custom type with class_name Bullet in Bullet.gd, then var bullet_instance: Bullet = Bullet.instance(). This will give us access to everything in the parent class (Area2D), as well as custom methods and properties like speed. Hope this helps someone!
@jmbiv_dev
@jmbiv_dev 3 года назад
Thanks for leaving this note! We do a lot more explicit typing as they progress but not always as much as we should early on in the series. I'm sure others will find this helpful!
@boerbol9422
@boerbol9422 2 года назад
Thanks!!
@amirvelasquez7874
@amirvelasquez7874 4 года назад
Thanks bro!! I'm loving this series!
@lennyvanriel1660
@lennyvanriel1660 3 года назад
Thank you for these videos. You've got a nice way of explaining things
@jmbiv_dev
@jmbiv_dev 3 года назад
Thanks, I appreciate the kind words, glad that they've been helpful!
@shawnfox1550
@shawnfox1550 Год назад
var velocity = direction * speed * delta will fix the lightning bullet issue.
@yufan
@yufan Месяц назад
instead of just add_child(bullet),you can add the child to the main scene instead and then set the transform.
@wastedlife4842
@wastedlife4842 Год назад
13:20 - in godot 4 bullet.instance() not working. But bullet.instantiate() works.
@nevo2010
@nevo2010 10 месяцев назад
try @export var bullet : PackedScene
@alexk1963
@alexk1963 9 месяцев назад
It doesn't work for me either
@SludgeCorpInCorp
@SludgeCorpInCorp 2 года назад
genuinely amazing teacher, I hope you have a great future and a great life, thank you :))
@jmbiv_dev
@jmbiv_dev 2 года назад
Thanks so much for the kind words, glad the videos have been helpful!
@TheCrazyenovy
@TheCrazyenovy 2 года назад
your videos are so nice for newbie like me. Please keep going for the Godot 4 / 3.5 tutorials
@jmbiv_dev
@jmbiv_dev 2 года назад
Thanks so much for the super thanks! I really appreciate it, and am so glad that these videos could be helpful for you. Absolutely, more tutorials coming! I've been doing a lot of work in Godot 4 and hope to have some exciting stuff coming soon.
@MossSkullGames
@MossSkullGames Год назад
Hey! I'm working in godot 4.0 and the code at 11:50 doesn't seem to work for me. I am getting the error message Unexpected "Identifier" in class body. What should I do to resolve this?
@jmbiv_dev
@jmbiv_dev 8 месяцев назад
In Godot 4.x, the syntax for export variables has changed. So, previously it was: export (PackedScene) var bullet But now export is an annotation that uses the @ symbol. You also don't give a type hint, you just explicitly type your export variable. So, altogether, it should now look like this in 4.x: @export var bullet: PackedScene Hope that helps!
@MGNashi
@MGNashi Год назад
First off ! Thanks for making this tutorial. I was looking for someone who'd actually help with the coding process. I'm having a bit of a hard time with auto completing some lines. func unhandled_input always gets filled in with func _unhandled_input(Event) : instead of: func _unhandled_input(event: InputEvent) -> void: is there a reason why it does that ?
@jaysingireddy293
@jaysingireddy293 3 года назад
Thanks for the tutorials.
@jmbiv_dev
@jmbiv_dev 3 года назад
Of course, thanks for watching!
@fish4014
@fish4014 11 месяцев назад
19:03: the missile knows where it is
@brianoneal4117
@brianoneal4117 Месяц назад
Great tutorial! I'm trying to implement this into a 3d game throwing snowballs. I got it to work until the snowball spawns in the hand. I tried doing Vector3 instead of 2 and now every time I shoot, it spawns in a straight line not moving. Any tips?
@cmds.learning7426
@cmds.learning7426 4 года назад
bullet direction can use another way: when pawn a bullet , bullet.lootat(get_global_mouse_position) once. then velocity = vector(1,0).rotated(rotations)....
@jmbiv_dev
@jmbiv_dev 4 года назад
Good call!
@largelad1983
@largelad1983 4 года назад
This series is amazing! sorry if this is a bit of a noob difference but what is the difference between using event. vs input.? is event. exclusive for unhandled input or some other reason. thank you for the amazing videos :)
@jmbiv_dev
@jmbiv_dev 4 года назад
Thanks for saying that, I'm glad they've been helpful! And no worries at all, it's a good question. You're pretty much correct - "event" is exclusive to functions like "_unhandled_input". It's better to use "event" than just "Input" because then we are only responding to the specific input event that called the _unhandled_input function. This is why we respond to input in _unhandled_input and not _process, for example, because doing it in _process would call our input handling every single frame. We don't need to handle input every frame - we only need to handle it when the player actually provides some input, so it's a lot more efficient. Hope that makes sense!
@RealYoureShow
@RealYoureShow 8 месяцев назад
Godot 4 autofills a few things different, and I don't notice a difference when running each line. But for example: He will have: func _unhandled_input(event: InputEvent) -> void: GD4 will autofill func _unhandled_input(event): Is there any significant difference? I'm changing everything to be the exact syntax he uses just for consistency sake rn... Additional side note: another way to get @onready var end_of_gun = $endOfGun is to drag endOfGun and then hold ctrl just before releasing.
@jmbiv_dev
@jmbiv_dev 7 месяцев назад
Great question! The difference you see in my code isn't because of Godot 3 vs. Godot 4, but because I have an editor setting turned on that automatically adds static types to Godot's autocomplete. Static types aren't required (which is why your code works totally fine without them), but they are super helpful - and, in Godot 4.x (but not in 3.x), using static types can actually make your code run faster. I haven't double-checked this in Godot 4.x, but I believe the path to turn on the setting is this (from the Editor dropdown of the top menu bar): Editor > Editor Settings > General > Text Editor > Completion > Add Type Hints Not required but highly recommend turning it on and trying to use types in your code whenever possible!
@RealYoureShow
@RealYoureShow 7 месяцев назад
@@jmbiv_dev very cool! Turning it on right away!
@ISmellMopWho
@ISmellMopWho 3 года назад
I thought my shooting wasn't working, I couldn't see the bullets coming out at all. Turns out I can only barely see them when I set the bullet speed to 1. I have it in the physics_process function too so I don't know why it's still super fast.
@jmbiv_dev
@jmbiv_dev 3 года назад
The first potential issue I can think of is that you might not be normalizing the direction vector you're multiplying with your bullet's speed - can you check and make sure you're doing that?
@ISmellMopWho
@ISmellMopWho 3 года назад
@@jmbiv_dev I must've missed that and I can't find it in the video, is that in the bullet's script? The only thing I normalized so far was the movement direction to prevent the faster diagonal movement with the movement_direction=movement_direction.normalized()
@jmbiv_dev
@jmbiv_dev 3 года назад
@@ISmellMopWho You're right, not sure that's in the video. Can you make sure you're doing your code in 'physics_process' and not in 'process'? That could potentially be why it's moving so fast. If that isn't the issue, if you hop in the discord server I can help you debug further.
@vicvijay2129
@vicvijay2129 2 года назад
This is amazing! Thanks! Although, would you please tell me why you wrote func set_direction(direction: Vector2), instead of just set_direction( )?
@jmbiv_dev
@jmbiv_dev 2 года назад
Glad it's helpful! If we didn't include a direction parameter, we would have no way to tell our bullet which direction to go in. That's why we have to include that parameter (which is what you see within the parentheses!). Hope that helps!
@youssefal_janaby3250
@youssefal_janaby3250 Год назад
Hello, I have a simple question When the player moves, the bullets become inactive and come out from different places, and when the player moves, the bullets move with him. Do you have a solution?
@samuelprovenzano2655
@samuelprovenzano2655 4 года назад
So the whole video is straight forward and it helped alot but i am trying to make a game where you use the buttons to aim your shot instead of the mouse. In player.gd, line 42 - line 44 are for assigning where the bullet will go corrisponding to where the mouse is. Is there any way you can show me how to click a button so the bullet shoots to the right instead of where the mouse is? Thanks
@jmbiv_dev
@jmbiv_dev 4 года назад
Glad it was helpful! And good question. I'll give a quick answer, but can you give more context on how your game works? Does the player move at all, and do you want the player to be able to shoot anywhere or just a few fixed directions, like left/right/straight? Instead of using direction_to(), I would probably just set the rotation_degrees property on your player. So if the user hits the button to go to the right, do rotation_degrees += 30 (or some number that works) and then shoot. Is that what you're looking for?
@samuelprovenzano2655
@samuelprovenzano2655 4 года назад
The game i am making is 2 wizards get put on a feild and they have to kill the other player while dodging the other players projectiles. So far, i have the bullet spawning in at the wizards location but i just need the bullet to take off (shoot) when a key is pressed which i am having trouble doing. Once i know how to get the bullets to move, ill make it so the player can shoot up, down, left, or right using the rotation_degrees += 30 that you suggested.
@jmbiv_dev
@jmbiv_dev 4 года назад
@@samuelprovenzano2655 Sounds good, good luck with getting it working!
@samuelprovenzano2655
@samuelprovenzano2655 4 года назад
@@jmbiv_dev thank you
@chriscorbett2947
@chriscorbett2947 Год назад
Why do we export the packed scene from the player script? It’s seems unintuitive to me. Shouldn’t we export the scene from the bullet scene itself? Little confused haha. Thanks in advance!!
@jmbiv_dev
@jmbiv_dev Год назад
Sorry for the delayed reply! You're right, though, that the player script isn't really the best place to export the packed scene from. The issue in this video is that we don't really have any other place to export it from... yet! We don't have a separate weapon node/system built out, at least in this video. In just a few more videos we'll come up with a much better and intuitive system, so stay tuned 🙂
@xs4pp714
@xs4pp714 4 года назад
add_child thing lags me up. i dont know why. but when i manually put the bullet scene in the player it dont lag. so i guess that fix it xd. i dont know if its only me tho. lol
@jmbiv_dev
@jmbiv_dev 4 года назад
That's weird that add_child causes some lag. It shouldn't ever really with just one node, even on a super old computer. Manually adding the bullet scene to the player and hiding it until you use it is a good workaround though.
@joeanderton7709
@joeanderton7709 4 года назад
@@xs4pp714 omg thank you
@vickylance
@vickylance 4 года назад
@@xs4pp714 you might have spawned multiple bullet perframe on the player
@justadragon7060
@justadragon7060 4 года назад
you really deserve more subs and support nice vid! ur probably gonna help a lot for my own game, lots of similar shooter mechanics doe its not the main theme edit also the bullet doesn't move for me and I retyped the code 3 times so please help
@jmbiv_dev
@jmbiv_dev 4 года назад
Thanks for saying that, I really appreciate it! And nice, that's awesome, best of luck with your game. Are you seeing any error messages? If you try moving your slightly farther away from your player's body, do the bullets appear now? Sometimes they can collide with your player if they are too close. Let me know if that helps. Otherwise, feel free to join the discord server and I can help you more.
@justadragon7060
@justadragon7060 4 года назад
@@jmbiv_dev I redid it again and im at around 23:00 but the bullet doesn't appear anymore
@jmbiv_dev
@jmbiv_dev 4 года назад
Try moving the gun a little farther away from the body of the player/unit that’s shooting it - sometimes the bullet instantly collides with the body if it’s too close
@ilraptor9134
@ilraptor9134 3 года назад
I have a question: why in the func _process there is the "(delta: float) -> void:" what is the difference from writing only (delta)?
@jmbiv_dev
@jmbiv_dev 3 года назад
Great question! the ":float" is declaring what type of thing delta is - it's part of Godot's static typing system, which is really awesome and worth learning about. I've got a video with more info you can check out here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-2K150BYhQ_8.html
@tomasavendanozacarias5205
@tomasavendanozacarias5205 2 года назад
Im having problems with the position spawning part, it dosnt recognize object.global_position as a thing and it returns null
@jmbiv_dev
@jmbiv_dev 2 года назад
That probably means that, wherever you're getting a reference to "object," the "object" in question is null. Try making sure that "object" is actually being set to a real thing, and if you're still having trouble we can help more in the discord server!
@johndoe35717
@johndoe35717 Год назад
20:02 that line of code doesnt work in my editor
@jmbiv_dev
@jmbiv_dev Год назад
You'll have to give more info before we can help out - are you getting an error? What does it say?
@BlinMaker
@BlinMaker Год назад
At line : var direction_to_mouse = Bullet_instance.global_position.direction_to(target).mormalized() i'm geting this error : Invalid call. Nonexistent function 'mormalized' in base 'Vector2'. Cam someone explain me how to fix it?
@jmbiv_dev
@jmbiv_dev Год назад
It looks like you misspelled “normalized” as “mormalized” - that should fix it!
@Frosty429
@Frosty429 Год назад
my bullets dont move they just stay in front of the player
@bombintheseeinq
@bombintheseeinq 2 года назад
i spent a while(like, 10 minutes) trying to figure out what i did wrong, and it turns out i misspelled global_position as global_positon. currently crying in the corner
@jmbiv_dev
@jmbiv_dev 2 года назад
sounds like coding 🙃
@rbcodder1701
@rbcodder1701 2 года назад
this is an amazing tutorial, thank you, but my bullet kept going to right-down even if my mouse was pointing somewhere else, why is it like that?
@jmbiv_dev
@jmbiv_dev 2 года назад
Sorry you're having trouble! I'm not sure what might be going wrong just off your comment - try following the next video and see if that helps. Otherwise, if you join our discord server, you can post some images of what's going wrong and that will make it easier for us to help you!
@rbcodder1701
@rbcodder1701 2 года назад
@@jmbiv_dev actually i didnt follow these series,im new and just came for adding shooting mechanic for my game, probably thats why it didnt work for me, right now i use raycast, but when i want to make a more detailed shooting mechanic, i will come and follow these series, thanks ! watching you screen change tutorial rn :D
@jmbiv_dev
@jmbiv_dev 2 года назад
@@rbcodder1701 ah, gotcha! cool, hope that you've had a good experience learning Godot, and like I said, we're here to help in the Discord server if you ever need it!
@jamesxxxyz8775
@jamesxxxyz8775 4 года назад
Example: when mouse_position is over player head, bullet shoot backwards...
@jmbiv_dev
@jmbiv_dev 4 года назад
Is that something you're seeing in your own game after this video? If so, try watching the next part (#4) and see if it's fixed there. We clean up some issues with our shooting code and do some other fixes there. If it doesn't fix it though, then just post a comment there and I can help.
@jeromewastijn5645
@jeromewastijn5645 4 года назад
Thx but my bullet doesn't collide with my tilemap
@jmbiv_dev
@jmbiv_dev 4 года назад
This is because of the _on_Bullet_body_entered() function in our bullet script. It's set to only handle collisions with physics bodies that have the "handle_hit()" function. If you want it to collide with tiles in your tilemap, you'll have to also add some handling for that within that body_entered function. Hope that helps!
@jeromewastijn5645
@jeromewastijn5645 4 года назад
@@jmbiv_dev I have put my tilemap in a group and then did if body is in group tilemap queue.free
@jeromewastijn5645
@jeromewastijn5645 4 года назад
@@jmbiv_dev and thanks
@jmbiv_dev
@jmbiv_dev 4 года назад
@@jeromewastijn5645 Awesome, glad that you were able to get it working!
@wolfystrider
@wolfystrider 3 года назад
Export PacketScene var bullet is giving me this error. My Gofot seems to be in a whole different launguage, expecting different terms that yours. here is the error - Expected a constant expression
@jmbiv_dev
@jmbiv_dev 3 года назад
This might just be a typo in your comment here, but make sure it is "Export (PackedScene)" instead of "Export PacketScene" Other than that, the "expected constant expression" error often occurs when you forget to add a ":" to a function or a type or some other value. Take a close look at the line with the error and make sure you don't have any syntax errors. If you still have trouble, join our community discord (link in the description) and I can help you further!
@wolfystrider
@wolfystrider 3 года назад
@@jmbiv_dev Oh I see! It's fixed thanks! :D
@jmbiv_dev
@jmbiv_dev 3 года назад
Great, glad that did it!
@amyong4850
@amyong4850 3 года назад
For some reason, my bullet spawns but does not carry out its code. It just stays in the same place. Can you help me? Also, I found these tutorials really helpful. thanks!
@jmbiv_dev
@jmbiv_dev 3 года назад
Have you placed any breakpoints or print statements in the code that gives your bullet velocity? If not, try doing that and make sure you're actually getting a velocity passed in to it.
@mikeyjnz
@mikeyjnz 2 года назад
a year late, but I had the same problem, I had attached the script to the referenced bullet node in my main scene, not in the bullet scene itself
@BumpDev
@BumpDev 4 года назад
It's Telling Me Non-Existent Function Whenever I Run The Game After 23:10
@jmbiv_dev
@jmbiv_dev 4 года назад
What function is it saying is non-existent? Can you double check and make sure that function is spelled correctly/in the right spot?
@TranZitJr
@TranZitJr 7 месяцев назад
@@jmbiv_dev Sorry to necro post but I'm having the same issue, started this video from scratch twice and still the same result, says the function 'set_direction' is nonexistent in base 'Area2D'. edit: joined the discord and immediately got the answer to my problem :) if anyone else stumbles upon this, make sure your bullet script is tied to the node (oops)
@tuguldurbayartsolmon1852
@tuguldurbayartsolmon1852 2 года назад
when i add bullet_instance.global_position=end(yeah i put that name on var).global_position i dont see any bullet or any if i remove this child appeas i tried bullet_instance:Area2d and create class name i didnt work any solutions EDIT:FIXED just add get_tree().get_root().addchild
@jmbiv_dev
@jmbiv_dev 2 года назад
Glad you were able to get it fixed! I believe that we also do a bunch of fixing this in the next video, too.
@a_commenter
@a_commenter 3 года назад
Why would you run the code in _physics_process instead of just multiplying by delta?
@jmbiv_dev
@jmbiv_dev 3 года назад
Good question - you absolutely can just use _process and multiply by delta, but it’s much less efficient because now your code is running every frame (60 to even 240+ times a second) instead of just running every physics step (usually like 8 times a second), so you’re doing dramatically more work that you don’t really need to do. There’s no real reason not to use physics process anyway - it’s a helper meant specifically for operations that will move a body or area and other physics objects, so by using physics process for those operations, it sets a standard/makes it easier to find those in a given script if you’re looking. There might be reasons to use regular process that I’m missing here, but 99% physics process is the better option.
@jmbiv_dev
@jmbiv_dev 3 года назад
Also I’m forgetting another important use - for things like rigid bodies, which are totally influenced by the physics system and not manual adjustment, physics process is the only function synced to the physics engine, so it’s the only function where you can reliably get a rigid body’s given position or scale, etc, at a specific time. So especially for rigid bodies even more than areas or kinematic bodies you want to use physics process.
@samuraikina5908
@samuraikina5908 3 года назад
hey Jmbiv, for some reason, my bullet manager is not doing anything, I printed code on player and it shows up area2d being spawned, but it doesn't shows up any print from bullet manager.... and I have all the code together :S
@jmbiv_dev
@jmbiv_dev 3 года назад
Hmm, that’s weird - can you join the discord server and post some pictures of your code (especially where the bullet signal is connected to the bullet manager)? We can help debug there.
@samuraikina5908
@samuraikina5908 3 года назад
@@jmbiv_dev its all good I forgot a "d" on one signal its solved now
@simplesten3450
@simplesten3450 Год назад
I’m a little late to the party but I keep getting an error: Invalid call. Nonexistent function ‘set_direction’ in base ‘Area2D’. Any help would be very appreciated!
@blastb34t
@blastb34t Год назад
Did you manage to resolve this? Check that your Bullet node has a script attached to it. You can see that if you open your Bullet scene, at the parent node of Bullet there should be a script icon next to it. If the script is missing, just re-add it.
@MamtaSharma-hc9qt
@MamtaSharma-hc9qt 3 года назад
Hello can anyone please tell me why my debugger is telling the instance in bullet.instance() is a non existent function
@jmbiv_dev
@jmbiv_dev 3 года назад
It might be because your bullet variable is null or is set to something that is not a PackedScene (a .tscn file) - can you make sure that you've dragged the correct thing into the editor for the bullet variable?
@MamtaSharma-hc9qt
@MamtaSharma-hc9qt 3 года назад
@@jmbiv_dev Yeah thnx bro it solved my issue. Actually I'm Swayam a 13 year old from my mother's phone.
@zombboi
@zombboi 3 года назад
My bullet spawns randomly. Anyone knows how to fix this?
@jmbiv_dev
@jmbiv_dev 3 года назад
What do you mean by spawns randomly? It spawns at random times, or it spawns in a random location/not where you would expect it to?
@zombboi
@zombboi 3 года назад
@jmbiv I fixed it already i just did something wrong while coding. Sorry!
@jmbiv_dev
@jmbiv_dev 3 года назад
No worries, glad you figured it out!
@Kazakbay
@Kazakbay Год назад
hotline Miami
@qqun
@qqun 3 года назад
the end of a gun is called muzzle, i searched it up. im gonna name mine muzzle instead of end of gun
@jmbiv_dev
@jmbiv_dev 3 года назад
You're correct! That's probably a better name for it.
@qqun
@qqun 3 года назад
great tutorial by the way, im now on part 9 and im loving it
@jmbiv_dev
@jmbiv_dev 3 года назад
Thanks, appreciate it! Glad you're enjoying them!
@s71402san
@s71402san 2 года назад
End of gun? It's called muzzle.
@jmbiv_dev
@jmbiv_dev 2 года назад
Which is what we call it for the rest of the series 🙂
@kuru_oka
@kuru_oka 2 года назад
Я понял что мне нужно учить английский...
@Clarkaraoke
@Clarkaraoke Год назад
Man... this tutorial simply does NOT wish to play nicely with Godot 4. I figured "I'll just translate it to gsl2" but I'm getting a new error every minute of tutorial. I've solved like 3 of them so far and right now the major error I'm getting is: bullet.instatate.set_direction(direction_to_mouse) Underneath the bullet script is throwing the error "Invalid Call, Nonexistant Function "Set Direction" in base "Area2d" I've asked on the discord and everybody seems stumped I wish someone could redo this tutorial for godot 4, very frustrating when 90% of the material on youtube is obsolete
@MossSkullGames
@MossSkullGames Год назад
Hey! I am also having problems getting this tutorial to work in godot 4. How did you get the packed scene at 11:50 to work? I'm sorry that I can't really help with your problem cause I'm just as stumped as you are.
@Clarkaraoke
@Clarkaraoke Год назад
@@MossSkullGames The fix is to change this line of code to "@export var bullet: PackedScene" but you're just going to encounter more errors about 30 seconds of video from now xD If you figure out my problem, do let us know
@hoangkhuongtang6111
@hoangkhuongtang6111 6 месяцев назад
in Godot 4, Bullet.instance() is now Bullet.instantiate()
Далее
I Made A Physics Engine
6:59
Просмотров 143 тыс.
#JasonStatham being iconic
00:38
Просмотров 407 тыс.
OBLADAET - BARMAN
03:06
Просмотров 267 тыс.
We made Vampire Survivors BUT in 10 Lines of Code
7:08
I Made the Same Game in 8 Engines
12:34
Просмотров 4 млн
How to Make a Good 2D Camera
11:38
Просмотров 399 тыс.
Every 2D Node Explained in 9 Minutes !
9:19
Просмотров 312 тыс.
Top Down 2D Shooting in Godot
18:33
Просмотров 83 тыс.
10+2 AWESOME ADDONS for GODOT 4
8:36
Просмотров 138 тыс.
They made a game about philosophy...
23:19
Просмотров 458 тыс.