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
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)
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!
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!
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?
@@stephenmurya use the gun's transform forward as the forward direction for the projectile? apparently you are using the vehicles transform forward direction...
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.
@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 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.
@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.
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 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
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.
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.
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.
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?)
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.
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.
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?
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.
@@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
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
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.
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
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)
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
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.
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
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?
@@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
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
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
@@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?
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?
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.
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?
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.
@@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
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 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
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.
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?
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 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
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?
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.
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
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.
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
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?
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
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
Thanks a lot! Glad I could help :D
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)
Haha, thanks a lot man! Glad I could help! :D
@@ebsku now 2 but still deserves it
he should really have more subcribers
sry but its 2024 with 4k likes sry to break it too you
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!
fr tho also I cant believe you juste posted a comment
Great video! Can't wait for the rest of the series!
Thanks! The second part should be published this week :D (Hopefully... ^^)
theres only 2 parts
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!
Thanks my dude
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?
@@stephenmurya use the gun's transform forward as the forward direction for the projectile? apparently you are using the vehicles transform forward direction...
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.
It made me bullets not shoot through the center of the screen though
You are the Future Barckeys He left :(
@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
@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
@James Thwaites guess these tutorials are for people who have a basic understanding of unity c# and want to learn more
@@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.
@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.
Great tutorial mate and you solved my greatest issue, which is to make the projectile travel towards the center of the screen. Much appreciated!
Yeah indeed, that's a bit tricky :D Glad I could help you! :D
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!
it was super fast, i was just loading up my project when he started typing.
@@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
@@Detective_deptherbro 😭
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.
Sticky bullets sounds awesome
😎👍
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.
lol i was just watching one of Brackeys first person tutorials, now i wanted to make weapons.
im just so greatful Dave exists.
thanks for your work. you're vids are a great resource for those learning Unity!
Great video! i really liked how you showed us how to set the gun up! thanks!
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.
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?)
I know its late but you probably have another scrips called "Camera"
The next Brackeys. LONG LIVE THE KING
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.
yeah......................................... its..................................... the................................. best..................................... one................................................ :)........................................
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.
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?
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.
@@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
why are you only at 14k you deserve more
Thanks a lot!
Great video, brother! :)
OH MY GOSH AM I THE ONLY ONE WHO REALIZES THAT HE'S JUST COPY AND PASTING BRACKEYS VIDEOS
@@pumpkii not all but ye he's kinda doin that
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
Hi, ty... And if I need destroy clones after idk 3 bullets or imediatly after hit, what ican to do?
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
Got it sorted, messed up the "out ray" bit
@@Funoriginality Np, glad you could fix it :D
can u tell me how i can move my gun with dani player movement script
Is there any way to make the bullets do damage to an AI?
Keep Going man. Love it!
Great tutorial :)
Thanks a lot! :D
Amazing tutorial! You are awesome !!!! Thankyou
Glad you like it!
Yo this was absolutely interesting because I'll maybe make a fps after my RPG where this will be incredible helpful thanks man
Glad you liked it! :D
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.
You are gods gift to noobs and professionals.
Sticky bullets would be cool😎
Like the plasma grenades in HALO😁👍
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
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)
@@davegamedevelopment k thanks
Did you add force to it? (if you didnt then go watch 5 : 13 there he adds force to the bullet)
thank you so much! this tutorial has helped me a lot
Hey, Im here from the Enemy AI tutorial, how do I combind this script with the enemy AI one?
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
@@zypherone how do I delete the projectiles after they have been shot
Have you do error ? You forget " { } " expression.. or its normaly .. you no close if..
You only need to add this expression when the if statement contains more than one line of code :D
Ok thanks 👌 🤓
You earned a subscriber
Thanks :D
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?
8:35 why you have a prefab called ender pearl!?
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.
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
@@davegamedevelopment THX
good shit man :)
Great tutorial!!!!!! keep going
Thanks a lot! I will definitely continue :D
sodint you cal it a remaster of your previous video?
Yeah it's kind of a better version of my any kinds of guns tutorial, this time with custom projectiles :D
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?
Good stuff. Thanks!
Trying to Invoke method: ProjectileGun.ResetShot couldn't be called. how do i fix this?
Thank you so much Bra-, I mean Dave.
"You don't want any upward force on your bullets"
Me who will create a gun with bullets similar to a boomerang :b
izvrsno nice work bro
Thanks man! :D
Sir how can i add dani gun reload animation on ur script plz tell me i need ur help
I don't know how to make the basic bullets do damage to my enemy, any help.
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
Make sure that the gun is a child object of your camera :D (Drag & Drop the gun into your camera object)
@@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
@@MrMikhaelJackson make sure the rigidbody is set to kinematic
can samobedy help me with how to add sound when you shot ?
If your making a FPS game, he also has a video on first person player movement which helped me alot
And lots of other movement tutorials :D
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
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
@@davegamedevelopment Great idea, thanks for the advice, I'll try to implement it!
@@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?
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?
The same things happing to me
you need to change where the shootpoint is
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.
Do you still need help?
Grate Tutorial! But i have some errors with directionWithoutSpread. How to fix it?
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?
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.
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!
@@kaiju_grim8434 Thanks for sharing + answering your problem :D
your tutorials make me go
Y E S
Thanks man :D
@@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
Great tutorial, ty, man, I'm lucky I found it ;)
Thanks a lot! Glad I could help you :D
Shouldn't we normalize the direction before applying spread?
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
The tutorial is awsome bot it always say (trying to invoke method : gun.resetShot couldnt be called
do you have a video how to make all type of guns for a 2d game?
When I try to shoot the gun shoot's only fire's one bullet how do I make it fire more bullets
not sure what im doing wrong, since i followed everything correctly but the bullets don't shoot. Am I missing something else?
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
thanks! this helped me too!
hi! sorry, but how could you make the camera not render anything?
@@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
My vcode does not autocomplete words even though I set it in preferences in unity and have the unity tools addons? Any help?
I try this but is not working : error CS0103 line 86,27 the name " RawSecurityDescriptor" does not exist in the current context ..
script link is not working
plz fix it
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.
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?
capital F
when i get close to something the bullets spread out more so its really hard to hit things
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
@@davegamedevelopment please can you make a tutorial about this, I'm kinda new on unity
@@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
@@davegamedevelopment ok thanks, your channel is very good by the way
@@josimar8497 Thanks! :D
Does this work for medieval weapons? Like bows, crossbows, etc.
It can
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?
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?
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
@@davegamedevelopment Thank you very much!
Hello brother I am using walking script without rigidbody I am using with character controller so can I how do use recoil system
How to type like u man, amazing skills, give some tips for typing . btw amazing video
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?
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.
Is the attackpoint a child of your gun?
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?
My bullet is spreading like crazy when i point at object.. how do i fix this?
I'm siting here wondering what do the Camshake and Shooting Ai variables come into play? Do I have to create something?
He has a video on ai and brackeys has a video on camshake.
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.
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
@@davegamedevelopment I added an extra "s" thanks for the tip would have never thought of that
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.
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
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?
My object is facing in other direction while i try to shoot. Please reply asap
The script is locked out of use because the " Script class cannot be found" Error, is there a way to fix it?
Does the character movement and gun setup come with this script? Or do I need to find it on my own?
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
AMAZING!!! But for some reason the bullets dont go to where my crosshair is?
You are amazing!!
dave i hope you see this how do i download the whole p;roject
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)
Can you make it so I dont have infinite ammo
Is it okay that I don't fully understand this code but use it?