How to make ALL kinds of GUNS with just ONE script! (Unity3d tutorial)

preview_player
Показать описание
How to make ALL kinds of GUNS with just ONE script! (Unity3d tutorial):
Here's how to make one script,, which lets you create any gun you like :D

All of the Links ^^:

🏹 Get Access to my RANGED COMBAT LAB! 🏹

➡️ Get Access to my full MOVEMENT LAB! ➡️

Support me on Patreon:

Thanks for watching, any questions pls in the comments, thanks!
Make sure to sub :)

Some tags (ignore, or read I don't care...^^)
unity3d,unity3d shooting,unity,unity tutorial,unity3d tutorial,unity3d gun tutorial,shooting,gun,unity shooting,unity fps tutorial,unity 3d tutorials for beginners,unity tutorial 2020,unity3d gun,gamedevelopement,gamedev,unity3d college,unity 3d fps,programming,coding,beginner,tutorial,assets,development,c#,weapon,how,to,tutorials,learn,game,shoot,easy,game development,howto,shooting in unity5,shooting gameobject,unity3d tutorial for beginners,how to make a game, unity, unity gun tutorial, unity3d tutorial, unity3d c#,unity gun,unity shooting,unity gun tutorial,unity 3d,unity 3d gun

#unityshooting #unityweaponsystem #unityguntutorial
Рекомендации по теме
Комментарии
Автор

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:

Thanks so much for watching, hope this tutorial has helped you!

davegamedevelopment
Автор

Amazing tutorial! Kept it interesting throughout the entire video, great clarity and quality, and one of the only tutorial videos that I don’t have to put to 1.5x speed. Good job!

koolgoose
Автор

I feel like this needs to be said, ShootAI and CamShake are different scripts if you get errors about them just delete the lines it isn't going to affect the code.

For an explaination on what they do, ShootAI is simply your enemy ai script and all the line does is make it so when you hit that ai they take damage equal to your damage parameter if you don't have ai yet this code returns an recognize error.

CamShake is a script that shakes the camera when you shoot this is the same thing if you don't have a camshake script it will return an error.

If your Muzzle flash isn't working make sure its set to play on awake, if its not it will wait for a trigger to play it, we don't use a trigger to play the effect.

If your bullet holes aren't rotating right set it to this Instantiate(BulletHoleGraphic, RayHit.point, just make sure that your variables are named correctly as I prefer a different naming convention all this does is makes it so we us the the bullet holes normal rotation as opposed to setting on manually.

Instantiate(BulletHoleGraphic, RayHit.point,
Your bullet hole Your ray Your ray variable
variable variable

haydenmcturk
Автор

I found Brakeys' second channel! Woohoo!

Andyhl
Автор

Was the explanation a bit too fast, or could you keep up easily? :D
And do you want to see more tutorials, if yes, which ones?

davegamedevelopment
Автор

I haven't started the code yet but I already know that this tutorial will be EXACTLY what I need for the game I wanna make

obnoxiousnoise
Автор

This channel has single handedly helped me relearn c# and unity. Fantastic resource, straight to the point.

sama-vhge
Автор

Very clean explanation! You had a lot of information packed into a short amount of time, which was great! Keep it up :)

JVCB
Автор

We all know you are just brackeys doing his Elizabeth holmes voice impression.

Just kidding you’re awesome great videos man very educational!

trader
Автор

amazing and straight forward!! definitely will recommend this to anyone who needs a simple and useful gun system. good work :D

nput_
Автор

Man You are EPIC
But please upload more tutorial(Noobs really need it-just like me)

divyanshpathak
Автор

Damn was this frustrating, but after finally getting it to work I'm loving it. Can't wait to build upon this foundation. Thank you so much for helping this complete beginner!

PostcardFromADream
Автор

really good, I also like making game so this is really helpful! I personally like more scriptableobjects but each one has its own way!

Magaelcrack
Автор

Thanks for putting the code in the description otherise i would have been siting here for 3 hours writing all the code amazing tutorials i wish you success!

ItzBetrayed
Автор

This is amazing most precise, straight forward script i have seen for setting up weapons. I have two questions firstly can the same script be assigned to various different weapons and tweaked to match it. The second more complex question is can this be adapted and used with VR if so could you do a video on that if its not too much trouble. But thanks again for soo much information in such a short amount of time!

Jay___ink
Автор

Great tutorial! Are there any tutorial videos on how to make the gun ammo limited so you have to pick up extra ammo from the environment around you?

withiethecryptid
Автор

Your spread is going to result in a box rather than a cone. Create a vector2 and normalize it to make it a conical spread.

wtmftproductions
Автор

Can you help me? I'm having a problem where the bullets hole only stick to one rotation and dont rotate, so for example if im inside of a cube only one side has the right bullet hole rotation and the rest is rotated

marcopadeiro
Автор

If you have problems like:

1. Bullet holes spawns at 0 0 0 coordinates.
2. Bullet holes are incorrect shape or rotation.
3. Muzzle effect doesn't disapear or you can't see it.
4. You have an errors.
5. Other stuff like this.

Then just replace this part of code:


if (Physics.Raycast(fpsCam.transform.position, direction, out rayHit, range, whatIsEnemy))
{


if

}

//Graphics

Instantiate(bulletHoleGraphic, rayHit.point, Quaternion.Euler(0, 180, 0));
Instantiate(muzzleFlash, attackPoint.position, Quaternion.identity);


To this:


GameObject flash = Instantiate(muzzleFlash, attackPoint.position, Quaternion.identity, attackPoint);
Destroy(flash, 0.1f);

if (Physics.Raycast(fpsCam.transform.position, direction, out rayHit, range))
{
if (((1 << & whatIsEnemy) != 0)
{


// if
//
}
else
{
Instantiate(bulletHoleGraphic, rayHit.point,
}
}


If you still did not see the muzzle effect, then open the file location of the muzzle effect in Unity, select it and in the inspector scroll a little bit down and turn on "Play On Awake*" mark.

dellusenew
Автор

For some reason muzzle flash and bullet holes are both invisible. The muzzle flash is appearing where it should in the scene but in game I cant see it, the bullet holes go to 0, 0, 0. Any fix for this?

edit - to fix no muzzle flash issue check play on awake in the muzzle flash prefab

Adrakxys