SHOOTING with BULLETS + CUSTOM PROJECTILES || Unity 3D Tutorial (#1)

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 424

  • @GodBeast_FireOnHell
    @GodBeast_FireOnHell Год назад +6

    I just start making my first game and watched so many tutorials to solve my issues but none of them helped, then I see your channel and it have every single video I need, love you work sir

  • @divyanshpathak2506
    @divyanshpathak2506 4 года назад +56

    Haha Just at the perfect time...I am making an fps game and really wanted a nice easy custom projectile shooting tutorial and their we go.Dave your game development and tutorials are awesome.I am sure that you will hit 1 million really fast(Like really fast)

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +4

      Haha, thanks a lot man! Glad I could help! :D

    • @aaronscreations947
      @aaronscreations947 2 года назад +1

      @@ebsku now 2 but still deserves it

    • @randoavis2
      @randoavis2 Год назад +1

      he should really have more subcribers

    • @sonoakneely9574
      @sonoakneely9574 6 месяцев назад

      sry but its 2024 with 4k likes sry to break it too you

  • @GlasTaibhse
    @GlasTaibhse 11 месяцев назад +2

    your vids are great, thanks for always uploading quality tutorials and content! always to the point, and the foundation you provide in your vids is super easy to expand upon. thank you!

    • @Blaxe75
      @Blaxe75 11 месяцев назад

      fr tho also I cant believe you juste posted a comment

  • @stevenjuana3920
    @stevenjuana3920 4 года назад +12

    Great video! Can't wait for the rest of the series!

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +3

      Thanks! The second part should be published this week :D (Hopefully... ^^)

    • @sonoakneely9574
      @sonoakneely9574 6 месяцев назад

      theres only 2 parts

  • @non-shockingtopics7563
    @non-shockingtopics7563 2 года назад +43

    I know it's been a while since this video came out so apologies if you've already fixed/moved on from this in the time since, but I noticed some problems with the way your spread is calculated and have personally fixed them to share with you and anyone passing by.
    1. Your spread calculates purely based on the target point's position, it doesn't get bigger the further away it is, meaning stuff like shotguns would be super OP and accurate at very far distances (which is fine if this was intended, but it didn't work for my project). I fixed this by always setting the target point to a constant position in front of the gun muzzle (5 in my case).
    Use this:
    Vector3 targetPoint = ray.GetPoint(5f);
    Instead of the raycast if else block to determine the hit point.
    2. Your spread also calculates in only the x and y directions, meaning if I face the x direction there is no horizontal bullet movement because there's no z spread.
    Just add another Random.Range for the z direction in directionWithSpread for this to be solved:
    float x = Random.Range(-spread, spread);
    float y = Random.Range(-spread, spread);
    float z = Random.Range(-spread, spread);
    directionWithSpread = directionWithoutSpread + new Vector3(x, y, z);
    Hope this helps someone!

    • @mutatedsun6047
      @mutatedsun6047 2 года назад +1

      Thanks my dude

    • @stephenmurya
      @stephenmurya 2 года назад +2

      Wow this really helped fixed some issues I was having with the code. I'm trying to implement this on a gun mounted on a car (sort of how a tank would function.) The bullet instantiates at the gun tip, but it goes in the direction the car is facing, instead of where the gun is facing. Could you help me out with it?

    • @あれくす
      @あれくす 2 года назад +2

      @@stephenmurya use the gun's transform forward as the forward direction for the projectile? apparently you are using the vehicles transform forward direction...

    • @orangeplumbob
      @orangeplumbob Год назад

      To add to this instead of giving the targetPoint a hard number, give it a variable like spreadDistance so that each gun could have a different spread difference. A shotgun with a close distance, where a sniper would have a farther distance.

    • @Eastyoffutt
      @Eastyoffutt Год назад

      It made me bullets not shoot through the center of the screen though

  • @crazycraftcreations6625
    @crazycraftcreations6625 4 года назад +104

    You are the Future Barckeys He left :(

    • @jlgaming9997
      @jlgaming9997 4 года назад +2

      @James Thwaites you need to give him time he is a human and is evolving his video instead of criticizing gove him suggestions im sure he will improve

    • @jlgaming9997
      @jlgaming9997 4 года назад +1

      @James Thwaites oh yeah and he isnt overcomplicating the script he is making it download friendly and adding extra bools that u would not need .
      for example if u want a object to go to point a from the available point a and b
      then u will require the tutorial for a but other people would want to go to b
      would need a tutorial for b
      he is making is code compatiable for both a and b
      ok just realised i typed too much here lol

    • @not_herobrine3752
      @not_herobrine3752 4 года назад +2

      @James Thwaites guess these tutorials are for people who have a basic understanding of unity c# and want to learn more

    • @austinwhiteted8231
      @austinwhiteted8231 4 года назад +1

      @@not_herobrine3752 yee, but remember c# gets easy to remember after some time. (I'm 16 and making my first fps game. its a mixture of ray cast and physical bullets) it just depends on how active you are too.

    • @adhochero6619
      @adhochero6619 3 года назад

      @James Thwaites I think these videos are great, brackes videos are still up for beginners, but they are to basic for me these are at a great pace for those that already kinda know what they are doing and can watch this real quick and get good ideas on how to set some of this stuff up better.

  • @MrHerrJonsson
    @MrHerrJonsson 4 года назад +3

    Great tutorial mate and you solved my greatest issue, which is to make the projectile travel towards the center of the screen. Much appreciated!

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +2

      Yeah indeed, that's a bit tricky :D Glad I could help you! :D

  • @ArranAsh
    @ArranAsh 4 года назад +8

    Although the video was fast I paused it at times to read up on what each bit of code did and why it needs such parameters. Overall it's been really useful to start off with and I thank you a lot for making this video!

    • @thecrispyacorn
      @thecrispyacorn 3 года назад

      it was super fast, i was just loading up my project when he started typing.

    • @Detective_depther
      @Detective_depther 8 месяцев назад

      ​​@@thecrispyacorn my project was loading while i watched this video several times, got married, got kids, got old, preached the tales of my great adventure to my grandchildren, reincarnated, and came back to my project still loading

    • @thecrispyacorn
      @thecrispyacorn 8 месяцев назад

      @@Detective_deptherbro 😭

  • @stevethepirate
    @stevethepirate 10 месяцев назад

    awesome! thank you! a bit tricky at spots but just because i haven't tried to do it before. i still followed it and understand it well enough to try it myself now.

  • @Intro2Love
    @Intro2Love 3 года назад +1

    Sticky bullets sounds awesome
    😎👍

  • @burgerfanman
    @burgerfanman 3 года назад +22

    Wow this gives me such amazing Brackeys vibes :)
    I never knew that you could simply state a bool or a !bool inside an if query, I always thought you had write bool = true or bool = false.

    • @Tacky_I
      @Tacky_I 2 года назад

      lol i was just watching one of Brackeys first person tutorials, now i wanted to make weapons.

  • @erentst
    @erentst 2 года назад

    im just so greatful Dave exists.

  • @a3dadventure79
    @a3dadventure79 Год назад

    thanks for your work. you're vids are a great resource for those learning Unity!

  • @bumba5727
    @bumba5727 4 года назад +2

    Great video! i really liked how you showed us how to set the gun up! thanks!

  • @SacWebDeveloper
    @SacWebDeveloper Год назад +2

    Awesome video, but one little thing. A shotgun does not shoot multiple bullets per trigger press, it shoots a shotgun shell which spreads little tiny balls all over the place. I think you don't need to keep multiplying and dividing the number, but just spawn that many each time you shoot.

  • @plumburger7010
    @plumburger7010 2 года назад +2

    Got a random error, would be really helpful if you could answer!!
    Assets\Scripts\ProjectileGun.cs(67,26): error CS1061: 'Camera' does not contain a definition for 'ViewportPointToRay' and no accessible extension method 'ViewportPointToRay' accepting a first argument of type 'Camera' could be found (are you missing a using directive or an assembly reference?)

    • @andreaslarsson1279
      @andreaslarsson1279 Год назад

      I know its late but you probably have another scrips called "Camera"

  • @HOMOLUDENSJM
    @HOMOLUDENSJM 3 года назад +1

    The next Brackeys. LONG LIVE THE KING

  • @nikhilchhetri900
    @nikhilchhetri900 4 года назад

    Searched a lot for moving a prefab in the raycast direction, nothing solved my issue....... went through a lot of blogs and videos....... and finally I found this tutorial......thanks a lot for this. This is the best way I've come through to solve my shooting issues.

    • @bytefloww
      @bytefloww 2 года назад +1

      yeah......................................... its..................................... the................................. best..................................... one................................................ :)........................................

  • @sergibonell5400
    @sergibonell5400 2 года назад +4

    I tried implementing this but I found a problem, if the Raycast hit is behind the firing point (or really close to it) the bullet won't shoot forward, and will shoot sideways instead. Do you know how could I fix this? I've been thinking about itbut I have no idea.

  • @JustMatt221-w6x
    @JustMatt221-w6x 10 месяцев назад +1

    New to Unity and really enjoyed this tutorial. Everything is working great except my muzzle flash will start at the attack point but if my character is moving or if I'm looking around the muzzle flash will stay at the point where it was created. I've been working on it for a few hours to try and get the muzzle flash to move with the attack point but no matter what it will only stay at the point it was created. Any possible solutions I should try to explore?

    • @JustMatt221-w6x
      @JustMatt221-w6x 10 месяцев назад +1

      Solved my own issue. In case anyone else gets this, you need to add a fourth argument to Instantiate so that the muzzle flash that is created will transform with the attack point.

    • @shark_byte_clips
      @shark_byte_clips 8 месяцев назад

      @@JustMatt221-w6x Im having this issue, what does that fourth argument looklike? EDIT: I did attackPoint.transform.parent for the fourth argument and it seems to work :3

  • @youton_gaming
    @youton_gaming 2 года назад +1

    why are you only at 14k you deserve more

  • @suxpop2171
    @suxpop2171 4 года назад +2

    Great video, brother! :)

    • @pumpkii
      @pumpkii 3 года назад +1

      OH MY GOSH AM I THE ONLY ONE WHO REALIZES THAT HE'S JUST COPY AND PASTING BRACKEYS VIDEOS

    • @miguelanterodevsgaming6529
      @miguelanterodevsgaming6529 3 года назад

      @@pumpkii not all but ye he's kinda doin that

  • @cardboardtoaster2169
    @cardboardtoaster2169 2 года назад +1

    Either my shooting code is glitched or there's something wrong in my scene because whenever I shoot, the bullets go up instead of straight ahead

  • @Lentspleyageim
    @Lentspleyageim 3 года назад +1

    Hi, ty... And if I need destroy clones after idk 3 bullets or imediatly after hit, what ican to do?

  • @Funoriginality
    @Funoriginality 4 года назад +1

    I wrote up the script, put in the semicolons I forgot to write, and then got an error labeled
    "[10:20:50] ASsets\Gunz.cs(83, 27: error CS0165: Use of unassigned local variable 'hit'"
    I have the "RaycastHit hit;" line in there so I know it's defined, and I don't quite understand what's wrong, any help would be greatly appreciated

  • @mr.phantomdx10669
    @mr.phantomdx10669 3 года назад +1

    can u tell me how i can move my gun with dani player movement script

  • @SharkyVR
    @SharkyVR 2 года назад +2

    Is there any way to make the bullets do damage to an AI?

  • @BecksCraft
    @BecksCraft 3 года назад

    Keep Going man. Love it!

  • @AldinCraft
    @AldinCraft 4 года назад +4

    Great tutorial :)

  • @smbiplob9476
    @smbiplob9476 2 года назад +1

    Amazing tutorial! You are awesome !!!! Thankyou

  • @LionDev
    @LionDev 4 года назад +4

    Yo this was absolutely interesting because I'll maybe make a fps after my RPG where this will be incredible helpful thanks man

  • @clarkmeyer7211
    @clarkmeyer7211 3 года назад

    wow this looks amazing. Joining your discord. I hope you don't mind me asking questions about this because I have a procedural weapon generator that instantiates guns rather than them being placed in the world manually. At the moment I don't see anything that could be tricky to get to work but you never know haha.

  • @ScoutsStudios
    @ScoutsStudios 4 года назад

    You are gods gift to noobs and professionals.

  • @Intro2Love
    @Intro2Love 3 года назад +3

    Sticky bullets would be cool😎
    Like the plasma grenades in HALO😁👍

  • @oblo4952
    @oblo4952 4 года назад +5

    when I used the script and followed all the directions, when I shot it did nothing but create a bullet that didn't move...
    I don't know what I am doing wrong

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +3

      Does your bullet have a rigidbody and did you set the forward and upward force to something like 50 and 10? :D
      Remember you can also download the whole project over my discord server and see how everything is set up :D
      (And there's a second part of the series)

    • @oblo4952
      @oblo4952 4 года назад +1

      @@davegamedevelopment k thanks

    • @juliuslukosevicius9360
      @juliuslukosevicius9360 4 года назад

      Did you add force to it? (if you didnt then go watch 5 : 13 there he adds force to the bullet)

  • @cem8015
    @cem8015 2 года назад

    thank you so much! this tutorial has helped me a lot

  • @Ocer.
    @Ocer. 4 года назад +15

    Hey, Im here from the Enemy AI tutorial, how do I combind this script with the enemy AI one?

    • @zypherone
      @zypherone 2 года назад +1

      I just instantiate a bullet with the direction that they are facing when they are in attack range. Just keep in mind there’s a big that leads to them shooting above the player but you’ll be able to fix it I’m sure

    • @docgraal485
      @docgraal485 Год назад

      @@zypherone how do I delete the projectiles after they have been shot

  • @consultingprestig2096
    @consultingprestig2096 2 года назад +2

    Have you do error ? You forget " { } " expression.. or its normaly .. you no close if..

  • @ebrahimmomin7518
    @ebrahimmomin7518 2 года назад +2

    You earned a subscriber

  • @Devsycoder
    @Devsycoder Год назад

    I could also possibly implement this on my plane system right? If I implement the shooting system like a point of shot this is plausible right?

  • @john_p5162
    @john_p5162 3 года назад

    8:35 why you have a prefab called ender pearl!?

  • @perrylets
    @perrylets 4 года назад +4

    Can you make a tutorial about movement in a game like Karlson, Dani script is from a past version of unity, also can you make a tutorial of the make of levels.

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +3

      PerryLets Yeah maybe I‘ll do a movement tutorial series in the future, but for now could join my discord and download the project file used in this video. There you‘ll find a movement script based on Dani‘s (but with a lot of other stuff added) :D

    • @perrylets
      @perrylets 4 года назад

      @@davegamedevelopment THX

  • @travel2120
    @travel2120 3 месяца назад +1

    good shit man :)

  • @majitelpravdy9106
    @majitelpravdy9106 2 года назад +1

    Great tutorial!!!!!! keep going

  • @legoalternator2.014
    @legoalternator2.014 2 года назад +1

    sodint you cal it a remaster of your previous video?

    • @davegamedevelopment
      @davegamedevelopment  2 года назад

      Yeah it's kind of a better version of my any kinds of guns tutorial, this time with custom projectiles :D

  • @docrobust
    @docrobust 3 года назад +1

    I got it working but when I fire, the projectile stays in the air where the gun's barrel is and because it has a rigidbody, I collide with them and stop moving. Is there a way to get them to be thrust forwards and also be destroyed after a few seconds?

  • @aimlezz8855
    @aimlezz8855 2 года назад

    Good stuff. Thanks!

  • @oscarhughes1145
    @oscarhughes1145 2 года назад

    Trying to Invoke method: ProjectileGun.ResetShot couldn't be called. how do i fix this?

  • @satobi46
    @satobi46 2 года назад +1

    Thank you so much Bra-, I mean Dave.

  • @firecreeper90
    @firecreeper90 9 месяцев назад +1

    "You don't want any upward force on your bullets"
    Me who will create a gun with bullets similar to a boomerang :b

  • @kristijandrgestin863
    @kristijandrgestin863 4 года назад +1

    izvrsno nice work bro

  • @mr.phantomdx10669
    @mr.phantomdx10669 3 года назад

    Sir how can i add dani gun reload animation on ur script plz tell me i need ur help

  • @thewarfare202
    @thewarfare202 Год назад

    I don't know how to make the basic bullets do damage to my enemy, any help.

  • @MrMikhaelJackson
    @MrMikhaelJackson 2 года назад +1

    Hi, when I did everything it all worked! But when I move my camera around the gun doesn't move do you know how to fix it

    • @davegamedevelopment
      @davegamedevelopment  2 года назад

      Make sure that the gun is a child object of your camera :D (Drag & Drop the gun into your camera object)

    • @MrMikhaelJackson
      @MrMikhaelJackson 2 года назад +1

      @@davegamedevelopment I did it but when I go to play it just falls through the ground if I go into scene view I see that the gun container is moving and my gun is a child of it

    • @davegamedevelopment
      @davegamedevelopment  2 года назад

      @@MrMikhaelJackson make sure the rigidbody is set to kinematic

  • @matusgls
    @matusgls 3 года назад

    can samobedy help me with how to add sound when you shot ?

  • @ebrahimmomin7518
    @ebrahimmomin7518 2 года назад +4

    If your making a FPS game, he also has a video on first person player movement which helped me alot

  • @lindal93
    @lindal93 4 года назад +3

    Great lesson, thanks!
    I want to ask how you can make the whistle of a flying physical bullet? I tried to make the bullet an audio source, but the whistle of the bullet is extremely unstable for some reason

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +5

      Seems like Unity can't handle the audio stuff on such fast objects.
      You could make an audio manager that always checks if a bullet entered a certain range around the player (Physics.CheckSphere) and if so you could just instantiate your bullet sound at the position where it entered the players "hear" range :D
      I'm not sure how that's going to sound but I guess it's worth a try. :D

    • @lindal93
      @lindal93 4 года назад +1

      @@davegamedevelopment Great idea, thanks for the advice, I'll try to implement it!

    • @lindal93
      @lindal93 4 года назад

      @@davegamedevelopment As far as I understand, the checkSphere deals with object colliders. But what if the object does not have a collider? My bullet has only raycast beams, how then will the sphere check know that the bullet has crossed with it?

  • @xdxdxd6599
    @xdxdxd6599 3 года назад +3

    Awesome tutorial but got a little problem here, when I shoot the bullet, the bullet doesn't go to the center but instead it goes a bit left from the center. How can I make this go directly to the center?

  • @lari6872
    @lari6872 10 месяцев назад

    Hey, I have been having an issue with the muzzle flash it seems to always be facing one direction and doesn´t follow the rotation of the gun at all, I have been trying to fix this for hours.

  • @staskholopkin7739
    @staskholopkin7739 2 года назад

    Grate Tutorial! But i have some errors with directionWithoutSpread. How to fix it?

  • @mygamingimagination8173
    @mygamingimagination8173 3 года назад

    ok so i did all the coding and set everything up the exact same way but nothing happens. i dont have any errors its just that litterally nothing happens. please i have gone through so many tutorials and nothings working. i need help.
    ok so i fixed it a little. the bullet shoots but theres no muzzle flash and i put the flash on. whats up with that?

  • @kaiju_grim8434
    @kaiju_grim8434 4 года назад +1

    idk what I did wrong but in the console it says "Trying to Invoke method: NewPistol.ReloadFinished couldn't be called" so how do I fix this, because it wont let me reload.

    • @kaiju_grim8434
      @kaiju_grim8434 4 года назад +1

      If anyone else is having this problem I just figured it out, you have to adjust the time between shots, I just put mine at 0.1, and it worked!

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +1

      @@kaiju_grim8434 Thanks for sharing + answering your problem :D

  • @g5haco
    @g5haco 4 года назад +4

    your tutorials make me go
    Y E S

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +2

      Thanks man :D

    • @g5haco
      @g5haco 4 года назад

      @@davegamedevelopment hi dave can you pls make your wall run tutorial simpler and explain better its good and all that but its not that clear on the code and can you fix the project files it wont let me download it thanks :P

  • @mykytamolodtsov8734
    @mykytamolodtsov8734 4 года назад +1

    Great tutorial, ty, man, I'm lucky I found it ;)

  • @l.halawani
    @l.halawani 9 месяцев назад

    Shouldn't we normalize the direction before applying spread?

  • @psadicodes
    @psadicodes 3 года назад

    Hi, I want it to use in space shooter and I want to use it more than one. I'm using attack point array and for loop. It goes side a how do I fix

  • @Mrcorn000
    @Mrcorn000 3 года назад +1

    The tutorial is awsome bot it always say (trying to invoke method : gun.resetShot couldnt be called

  • @kareembutler5916
    @kareembutler5916 3 года назад

    do you have a video how to make all type of guns for a 2d game?

  • @mr.stan_007
    @mr.stan_007 2 года назад

    When I try to shoot the gun shoot's only fire's one bullet how do I make it fire more bullets

  • @Isimpforanimemen
    @Isimpforanimemen Год назад

    not sure what im doing wrong, since i followed everything correctly but the bullets don't shoot. Am I missing something else?

  • @fishperson5390
    @fishperson5390 2 года назад +2

    My bullets are only going straight forward not up or down independent of any inclination on the gun
    Idk if it has anything to do with having a system where it only goes first person while aiming
    Edit: I fixed it, the game is alternates between fixed cameras like old RE and first person when aiming
    I fixed it by having copying the first person camera, setting it to not render nothing and always copy the first person camera's rotation, and using that as FPScam

    • @urielcobo-cuisana2316
      @urielcobo-cuisana2316 2 года назад

      thanks! this helped me too!

    • @urielcobo-cuisana2316
      @urielcobo-cuisana2316 2 года назад

      hi! sorry, but how could you make the camera not render anything?

    • @fishperson5390
      @fishperson5390 2 года назад

      @@urielcobo-cuisana2316 Go on the inspector, in camera find cooling mask and change it from everything to nothing
      You can use this to select what layers the camera renders so you can make some stuff invisible and etc

  • @laugH_Clipz
    @laugH_Clipz 4 года назад

    My vcode does not autocomplete words even though I set it in preferences in unity and have the unity tools addons? Any help?

  • @consultingprestig2096
    @consultingprestig2096 2 года назад

    I try this but is not working : error CS0103 line 86,27 the name " RawSecurityDescriptor" does not exist in the current context ..

  • @mhze
    @mhze 2 года назад +1

    script link is not working
    plz fix it

  • @durgam_sumerian7815
    @durgam_sumerian7815 4 года назад

    Hi man and thanks for the great tutorial but, I can find a tutorial in your list channel about the 3d movement (Top, FPS..etc), maybe because I'm new in your channel. I know there are many tutorials for such subjects but I like to see your codes about it because it pretty cleared and work just great.

  • @obsidianross
    @obsidianross 4 года назад

    I got error code CS1061: Rigidbody does not contain a definition for 'Addforce' and no accessible extension method 'Addforce' accepting a first arguement of type 'Rigidbody' could not be found.
    Even though i had a bullet with a rigidbody before writing the script. What do i do?

  • @benjamingraham9122
    @benjamingraham9122 4 года назад +2

    when i get close to something the bullets spread out more so its really hard to hit things

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +1

      Yeah I know, that's a bit of a problem.
      You can eighter just turn down the spread value or try making a script that lowers the spread the closer you are to the target :D

    • @josimar8497
      @josimar8497 4 года назад +1

      @@davegamedevelopment please can you make a tutorial about this, I'm kinda new on unity

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +2

      @@josimar8497 Thanks for the idea, but I'm not sure if I'll do one (already planned others).
      But for now just lower the spread value in the Unity inspector :D

    • @josimar8497
      @josimar8497 4 года назад +1

      @@davegamedevelopment ok thanks, your channel is very good by the way

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +2

      @@josimar8497 Thanks! :D

  • @Dreskii04
    @Dreskii04 4 года назад +1

    Does this work for medieval weapons? Like bows, crossbows, etc.

  • @hopili1235
    @hopili1235 2 года назад +1

    Really great video. However, I intend to add multiple weapons and when I try to use the same script there are errors, is there a way to fix it?

  • @krisman-s4h
    @krisman-s4h 4 года назад +1

    I have one question. Why do my bullets instantiate one by one instead of at once and so my bullet text lowers the numbers
    one by one?

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +3

      If you set the "timeBetweenShots" to 0 and "bulletsPerTap" to something like 5, all of the bullets should spawn (nearly) at the same time :D

    • @krisman-s4h
      @krisman-s4h 4 года назад

      @@davegamedevelopment Thank you very much!

  • @jhariya_roopak
    @jhariya_roopak 2 года назад

    Hello brother I am using walking script without rigidbody I am using with character controller so can I how do use recoil system

  • @darshilpatel4322
    @darshilpatel4322 3 года назад

    How to type like u man, amazing skills, give some tips for typing . btw amazing video

  • @user-jt8qn6bn9i
    @user-jt8qn6bn9i 2 года назад

    So, I followed along with this tutorial, but I cannot get my Gun to shoot anything for some reason. Now I am getting an error on the console regarding the input system, but I already imported the new input system already. Any suggestions?

  • @uleesesrenzbalbastro3038
    @uleesesrenzbalbastro3038 3 года назад +1

    Hey, I'm having a problem with the position of the bullet and muzzle flash when I fire. The bullet and the muzzle flash doesn't rotate with the gun.

    • @whitesheep1417
      @whitesheep1417 2 года назад

      Is the attackpoint a child of your gun?

  • @axelhultstrom6333
    @axelhultstrom6333 3 года назад

    How would I make the bullets not bounce at all? When hitting any platform on the Ground layer, they sometimes bounce. Is there a way I can stop that?

  • @Mnap
    @Mnap 4 года назад

    My bullet is spreading like crazy when i point at object.. how do i fix this?

  • @FrostedWaffle
    @FrostedWaffle 3 года назад

    I'm siting here wondering what do the Camshake and Shooting Ai variables come into play? Do I have to create something?

    • @yourenotalone6583
      @yourenotalone6583 3 года назад

      He has a video on ai and brackeys has a video on camshake.

  • @L0rdBud
    @L0rdBud 4 года назад +1

    The script is great but when I shoot I get a console note that says "Trying to Invoke method: Gun.ResetShot couldnut be called." my script is called gun, this also happens when I reload seems it gets stuck in the initial shoot method and cant move on from there. I hope you see this.

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +2

      L0rdBud I normally get this error when misspelling the function name, make sure that‘s exactly „ResetShot“ :D
      If it still doesn‘t work maybe download the project file over my discord server and see how everything is setup there :D

    • @L0rdBud
      @L0rdBud 4 года назад +1

      @@davegamedevelopment I added an extra "s" thanks for the tip would have never thought of that

  • @rabi0ne
    @rabi0ne 4 года назад +1

    I mean... Your videos combined to Brackey's will make us creat the next AAA Game of all times!!
    I have a question tho; how to change MyInput method to use buttons instead of keys?? (i know how to use OnClick but that's it... it wont reconize the button hold.

    • @davegamedevelopment
      @davegamedevelopment  4 года назад +1

      Thanks a lot! Best of luck with your game :D
      For detecting button holds I would use the "Event trigger" component, then set it to PointerDown (that's the start of the hold) and another eventTrigger to PointerUp (end of the button hold)
      Hope that helps :D

  • @raidoukuzunoha9874
    @raidoukuzunoha9874 2 года назад

    I need to tick the trigger in the bullet prefab, thus it can damage the player. My prob is that after doin that, the wall doesn't block the bullets. If I untick istrigger, it will not damage the player.
    How can I make the wall can block the bullet if hit but at the same time, if it hits the player, it will damage the player?

  • @logmac2735
    @logmac2735 2 года назад

    My object is facing in other direction while i try to shoot. Please reply asap

  • @thesqwisher7543
    @thesqwisher7543 3 года назад

    The script is locked out of use because the " Script class cannot be found" Error, is there a way to fix it?

  • @IceezV2
    @IceezV2 3 года назад

    Does the character movement and gun setup come with this script? Or do I need to find it on my own?

  • @1JMGames
    @1JMGames 3 года назад

    Hey bro, how would one make a scripts so that when the player collides with a trigger they get a grenade that they can throw like in Mario cart, but then the script disappears after using it once

  • @artdays9561
    @artdays9561 2 года назад

    AMAZING!!! But for some reason the bullets dont go to where my crosshair is?

  • @umutbozkurt6860
    @umutbozkurt6860 3 года назад

    You are amazing!!

  • @Xenon_Doo
    @Xenon_Doo 2 года назад

    dave i hope you see this how do i download the whole p;roject

  • @cauejanzinic.6263
    @cauejanzinic.6263 2 года назад

    I don't know why, but my bullet when I shoot it, it keeps bouncing on everything non-stop. (rigidbody is already in interpolate and continuos)

  • @Cussaur
    @Cussaur 3 года назад +1

    Can you make it so I dont have infinite ammo

  • @panickal
    @panickal 2 года назад

    Is it okay that I don't fully understand this code but use it?