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
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.
I forgot to mention the DOWNLOAD LINKS in the video :D ➤DOWNLOAD THE SCRIPT: www.dropbox.com/s/xpjbpi597akdqku/ProjectileGunTutorial.cs?dl=0 ➤Download the whole PROJECT (channel #free-code-dave): discord.gg/5S3bBBq If you need help with any of the code shown, just visit the "coding-help" channel on my discord server :D Also you can find many more movement tutorials on my channel in the "Tutorials!" playlist - I really hope they help you on your further GameDev journey! And in case you're interested in getting access to my full RANGED COMBAT LAB, with which you can create pretty much any ranged ability/weapon you can think of, check out the trailer: 🏹 RcLab Trailer: th-cam.com/video/j2YplilHjCA/w-d-xo.html Thanks so much for watching, hope this tutorial has helped you! Thank you so much for watching! If you have any questions just write a comment, I'll answer as many as I can! :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)
@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.
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!
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
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.
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.
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.
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.
@@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
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.
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 have a trick: but u will need to play test on full screen mode. and in ur look script at start method: U have to write Cursor.lockmode = CursorLockMode.locked; This will make the cursor position on the center (Press esc key to able to move cursor) at the part, calculation of distance between point and player U can use mouse position instead of 0.5 u can do this by: create a variable Vector3 mousePos = Input.mousePosition; Ray ray = cam.ViewportPointToRay(mousePos);
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
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 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
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 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
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.
the muzzle flash is not showing but it is in did spawning, interesting. Edit: it looks like i forgot to turn on "play on awake", now the problem is solved, splendid
Great video! Only thing I changed was I didn't divide by bullets per tap. I feel like in most games I see, if it's a 3 round burst it'll just tick down 3 bullets after each shot.
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?
Hi, I loved the outcome but the thing that I don't like about your tutorials is that you make all the variables at the start and I can't understand what is happening. Like, at first you'll make the shooting and fire rate, then the spread and reloading and the other stuff. So it'll be better to make the variables when you need them. But again, great tutorial :)
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?
Very cool tutorial! I have a question though, To limit the amount of data being created by shooting projectiles can you include a way to despawn them after they are fired?
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?
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
@@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
It works great but i have a a few things i would like to tweak if you could help me please How to destroy the bullet after 2 seconds (I do know how to do this but its better if it comes from you as its your script and i dont place it in the wrong place
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
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
I forgot to mention the DOWNLOAD LINKS in the video :D
➤DOWNLOAD THE SCRIPT: www.dropbox.com/s/xpjbpi597akdqku/ProjectileGunTutorial.cs?dl=0
➤Download the whole PROJECT (channel #free-code-dave): discord.gg/5S3bBBq
If you need help with any of the code shown, just visit the "coding-help" channel on my discord server :D
Also you can find many more movement tutorials on my channel in the "Tutorials!" playlist - I really hope they help you on your further GameDev journey!
And in case you're interested in getting access to my full RANGED COMBAT LAB, with which you can create pretty much any ranged ability/weapon you can think of, check out the trailer:
🏹 RcLab Trailer: th-cam.com/video/j2YplilHjCA/w-d-xo.html
Thanks so much for watching, hope this tutorial has helped you!
Thank you so much for watching! If you have any questions just write a comment, I'll answer as many as I can! :D
Hippity hoppity your code is now my propery
Jk not actually
is the script the first script you start with
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
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.
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
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 😭
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
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.
The next Brackeys. LONG LIVE THE KING
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
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................................................ :)........................................
Sticky bullets sounds awesome
😎👍
im just so greatful Dave exists.
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 would be cool😎
Like the plasma grenades in HALO😁👍
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
thanks for your work. you're vids are a great resource for those learning Unity!
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.
You are gods gift to noobs and professionals.
Great video! i really liked how you showed us how to set the gun up! thanks!
why are you only at 14k you deserve more
Thanks a lot!
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
You earned a subscriber
Thanks :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
Amazing tutorial! You are awesome !!!! Thankyou
Glad you like it!
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.
Thanks, I will use this in a VR game
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"
I have a trick:
but u will need to play test on full screen mode.
and in ur look script at start method:
U have to write
Cursor.lockmode = CursorLockMode.locked;
This will make the cursor position on the center
(Press esc key to able to move cursor)
at the part, calculation of distance between point and player
U can use mouse position instead of 0.5
u can do this by:
create a variable
Vector3 mousePos = Input.mousePosition;
Ray ray = cam.ViewportPointToRay(mousePos);
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
thank you so much! this tutorial has helped me a lot
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
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
You are brackeys thanks mate
Keep Going man. Love it!
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
Is there any way to make the bullets do damage to an AI?
Great tutorial :)
Thanks a lot! :D
Love your videos...plz make a tutorial on enemy ai with anims
I'll definitely make a tutorial on fps enemy ai! Just give me a few weeks, currently also working on other videos :D
Great tutorial, ty, man, I'm lucky I found it ;)
Thanks a lot! Glad I could help you :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.
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)
thanks :)
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
Great tutorial!!!!!! keep going
Thanks a lot! I will definitely continue :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
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.
this mad man made a video on how to make an entire shooting system in 9 Minutes
it fast tho
Good stuff. Thanks!
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
the muzzle flash is not showing but it is in did spawning, interesting.
Edit: it looks like i forgot to turn on "play on awake", now the problem is solved, splendid
izvrsno nice work bro
Thanks man! :D
Great video! Only thing I changed was I didn't divide by bullets per tap. I feel like in most games I see, if it's a 3 round burst it'll just tick down 3 bullets after each shot.
Shouldn't we normalize the direction before applying spread?
script link is not working
plz fix 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
How to type like u man, amazing skills, give some tips for typing . btw amazing video
Really useful, But could you make the bullets disappear and use when they collide with something, This would be very helpful thanks.
Sure, just have a look at the second part of the series, there I explained how to make the explosion etc. :D
@@davegamedevelopment Thanks this will help a lot + U got a new subscriber :0
@@bennydaboy6984 Wow, 2 favorited comments in one, amazing!
Hi, I loved the outcome but the thing that I don't like about your tutorials is that you make all the variables at the start and I can't understand what is happening. Like, at first you'll make the shooting and fire rate, then the spread and reloading and the other stuff. So it'll be better to make the variables when you need them.
But again, great tutorial :)
You are amazing!!
AMAZING!!! But for some reason the bullets dont go to where my crosshair is?
Thank you very much
Perfect!
Thanks!
good shit man :)
PLEASE REUPLOAD FULL PROJECT... IN THE DISCORD, THE DOWNLOAD LINK FOR THIS GUNS & BULLETS PROJECT IS ACTUALLY THE PICK UP / DROP OBJECTS PROJECT.
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?
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?
TYSM
Very cool tutorial! I have a question though, To limit the amount of data being created by shooting projectiles can you include a way to despawn them after they are fired?
this was what i was thinking, like after a collision they should despawn
This is covered in the second part
Hi, ty... And if I need destroy clones after idk 3 bullets or imediatly after hit, what ican to do?
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 👌 🤓
can u tell me how i can move my gun with dani player movement script
Does this work for medieval weapons? Like bows, crossbows, etc.
It can
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?
Awesome video!
How you put that ammo pointer in there. I've been trying for over 2 hours and I can't figure it out.
Thanks
8:32 hesaid it there :) sorry for the delay
Thank u
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?
Can you make it so I dont have infinite ammo
do you have a video how to make all type of guns for a 2d game?
Grate Tutorial! But i have some errors with directionWithoutSpread. How to fix it?
The tutorial is awsome bot it always say (trying to invoke method : gun.resetShot couldnt be called
Thanks Pimp
thanks😁
amazing...
Acropolise Thanks a lot! :D
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
Is it okay that I don't fully understand this code but use it?
Cool
Thanks!
Dave / GameDevelopment you’re welcome
Thanks
not sure what im doing wrong, since i followed everything correctly but the bullets don't shoot. Am I missing something else?
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
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
It works great but i have a a few things i would like to tweak if you could help me please
How to destroy the bullet after 2 seconds (I do know how to do this but its better if it comes from you as its your script and i dont place it in the wrong place
Hey I have trouble shooting more than one bullet, it doesn't work, do you know why this could be?
I don't know how to make the basic bullets do damage to my enemy, any help.
thanks alot(:
My bullet is spreading like crazy when i point at object.. how do i fix this?
Is there a way to prevent bullets from glitching when the player is moving forward?
You sound like Brackeys ngl
Haha I know
is this Brackey's brother >?
Maybe, who knows