Make a FIRST PERSON SHOOTER in 10 MINUTES - Unity Tutorial
Vložit
- čas přidán 7. 09. 2024
- Let's make a FIRST PERSON SHOOTER in 10 Minutes!
● Sci-Fi Gun Light: bit.ly/3HuFC6y
● INSTALL UNITY: • INSTALL & SETUP UNITY ...
● Unity Rolly Vortex Game: bit.ly/3NLfNPQ
♥ Don't Click This! : bit.ly/2Zi3vu9
♥ My Second Channel: bit.ly/3jvI8g6
--------------------------------------------------------------------
✅ My current Productivity Setup 👇:
● Gaming Headset: amzn.to/3HyXgp2
● Gaming Mouse: amzn.to/3ni4Ygp
● Best Webcam: amzn.to/44pVUqw
● Keyboard: amzn.to/3ALXB3M
● GPU: amzn.to/42mylNt
● CPU: amzn.to/44lOBjs
--------------------------------------------------------------------
FOLLOW ME:
● Facebook: / developer3.5pro
● Sketchfab: sketchfab.com/...
--------------------------------------------------------------------
► All content by GDTitans is 100% free. I believe that education should be freely available to everyone.
A mobile version with a cool environment & Enemy AI's on mobile will just be soo amazing. Do make something like that man.
Everyone would like it
Thanks for your suggestions
@@GDTitans appreciated man few time ago , i have learned to make an endless runner of your series.
Learned a ton from it.
Again thanks for all of this effort.
##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
im total noob. its my first unity tutor i can complete. thx alot.
this did not take 10 mins it took me a day lol
FAX!
Still surprised what it didn't took whole decade
He told will only teach u in 10 min . Sadly 😢 .
It’s better then nothing
Indian scammer
great tutorial im using a different pack and had to rotate the gun and bulletpoint but the gun keeps shooting backwards
GDTitans How can i make it so the bullet destroys a gameobject with "enemy" as the tag?
Start new series about multiplayer and friendlist
you will need a server for that which can be complicated to setup.
Yes!
Kk
2:59 the convert seleted built in materials to URP is gray and wont let me interact/press it.
nah man the "3D BALLS" got me rolling on the floor
if your bullet shoots backwards or a little to the right, change your bullet speed to negative 600. i had the same problem and this should fix it.
Tysm
Wait, does it also work if it only shoots to the left?
@@LeGordoBondiola The rotation of the bulletPoint (where the bullet is created) is off. The bullet is created with the same rotation as the bulletPoint. The OP must have his bulletPoint pointing backwards so that changing the speed to negative makes the bullet move backward from the direction it was created in, which is the direction it should go in the first place.
To fix, change the setting in the top left of the Scene tab from "Global " to "Local". Then rotate the bulletPoint so the z axis (the blue arrow) is pointing forward. Unity considers the z axis as forward. If it is shooting left, try rotating the y axis of the bulletPoint's transform by 90 degrees.
@@elianderson727mine shoots to the left of my gun regardless of my rotation how do I fix?
@@porpoiseproductions1422 Here are a few things to try.
Make sure you are changing the rotation of the BulletPoint, not the gun or the bullet.
Make sure you are correctly referencing the BulletPoint in you Gun script (your BulletPoint should be dragged into the slot you created in the inspector with public GameObject bulletPoint). 10:37
In your Shoot() function, when you instantiate the bullet, try changing it's rotation (the last argument) to bulletPoint.transform.Rotation. 11:03
Mess with the freezing the bullet prefab's rotations 9:13
I always get the 'Type or namespace definition, or end-of-file expected' message in the console and i cant paly the game since it says 'All compiler errors have to be fixed before you can enter playmode!' I dont know how to fix this
Help. I don't have the first person template. where do I get it from? Ps. I am using unity 3.6.1 and editor version 2022.3.15f1 LTS
did u figure it out?
( i have the same prob )
@@arsfnp4644 you can use editor 2021.3.33f1(MAKE SURE ANDROID BUILD SUPPORT IS TURNED ON)
4:47 how did you open the StarterAssests in visual studio? For me it opens in google and i cant owerwrite anything in it
Go to Edit > Preferences > External tools
Then, change the External Script Editor
Where do i can find the first person mode
Idk
In the 2021 Editor version
This tutorial doesn't work I just get error messages. Can you create an updated one that works with the new unity versions or whatever?
Please help mine is shooting to the left
SAME... if u find a solution PLS TELL ME!
@@timeaverage I tried a couple different things the only thing that worked for me was in the gun script towards the bottom were it says transform.forward change forward to right or left or backward depending on which direction your bullet is going, i couldn't tell you why it's doing it, but that's what worked for me. Hope this helps
@@shrimplyawesome378TYSM! It fixed it! 😊
i attached the bullet to the gun, It says that my gun s firing but i only see the bullet 0.1 second when i strafge to the right. I changed the bullet speed to 1 but still cant see it....... Does anyone know why ????
impressive tutorial again. Thx my friend!
Thanks,
Really glad it was helpful!
It's not allowing me to attach the gun file to the gun I need help
Same
@@sahilmishra2012 Go to the Gun object. In the inspector window, drag the script (or "file") right on the Add Component button. Done!
Hi i am trying to attach the gun in the player capsule but its not attaching and its invisible.Please help me
birinchi yuz camerani qanday qilish mumkin player ko'zi bilan ko'rish uchun
Can you make a tutorial on adding crosshair and aim correctly. So that we shoot correctly
whenever i try to add the script to the gun it just says it doesnt work because the class file doesnt match the script name or whatever even though it quite literally does
If you're still having this issue make sure the script name is the same as the word right next to "Public class"
@@butterdog9483 im having this issue and i even tried just to create a script without renaming it and its still the same problem.
@@danielinserte9814 same
@@Cramped_is_sus Delete the script and try to create a new c# script with the same name
its the new or well now old Unity Version sorry! the team will try to resolve this
My bullet doesn't shoot to the crosshair in the middle of the screen but next to it, what can I do?
So you make the control to shoot on the player script, but how do you modify weapon behavior, swap models, that kinda thing? For instance how does burst fire work?
ayo i also need that information. did you figure out yet?
@@apfelhuhn let me know if either one of you find a good source of info for this kind of stuff please 😭❤️
Can u please do a video on how to make realistic shooter game
excuse me could anyone just help me I have a question if I use this project and change it will there be any problem if I upload the game I mean can I get money from it????\
i think as long as u dont make over 100k u good
@@nayrb727 Yes, but you have to get the Unity Premium version so you have rights
what a nice and clear tutorial. thank you
No worries
the code in this video didnt work but heres code that does the same thing
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
private bool _shoot;
// Start is called before the first frame update
void Start()
{
_shoot = false;
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
_shoot = true;
}
if (_shoot)
{
Shoot();
_shoot = false;
}
}
void Shoot()
{
Debug.Log("Shoot");
}
}
@@jamieandroidgaming5714 thx
wheres the code?
I'm looking this video whilst I sleep wish me luck
how do i get the first person option in creating a new project
I can’t find it either
help! My unity is 3.5.0 and I can't find first person template...
same
I want to gather people with these skills to develop a first shooter game, not just a game, but a special one. So that I will tell them what to make, how each character moves and attack, what environment and so on.
Would you please direct me where to start or how to get in contact with another person that knows better that should tell me what to do from start to end please?
Do you have the money to pay these people? You know how long creating something like this takes, right? Lol...
I'm very curious what your idea is
how can I change the default keybind settingd to zqsd ?
how to read input to do automatic fire? In other words, how to create get input if (Key is held down during next frame update?)
Thank you for the nice tutorial
I believe you can just copy the code from the sprint logic. Sprinting works by holding sprint button down.
@@Ultrapassive I'm going to try that. I didn't even think of that
@@manuelhernandez2017 how'd it go?
Really helpful and clear, thanks
Glad it was helpful!
For some reason my unity says that the type or namespace StarterAssestsInputs can’t be found. I’m using the correct namespace and the problem is still there. Please help
You have to put the starerassetsinputs script on your gun
Have you installed the Starter asset plugin from the package manager?
hey so i used this tutorial and its a really good one but idk why but the bullets go to the right instead of forward how do i fix this?
I'm guessing the transform is off on the bulletPoint (where the bullet is created). The bullet is created using the rotation of the bulletPoint. Force is then applied in the direction it is facing (using "transform.forward * bulletSpeed"). Unity considers the z axis (the blue arrow) as forward.
In the top left of the Scene view change the setting from "Global" to "Local". Select the bulletPoint and rotate it so the blue arrow is pointing forward (if it's shooting right, rotate the y rotation by -90). That should fix it.
No,
Check gunpoint rotation
My bullet just ascends into the backrooms. Is there a way to fix that?
go to the bullet prefab and go to it's rigidbody and change the collision detection from discrete to continous
@@BO0O0O0O0O0O0O0O0M That was like 3 months ago. I quit game developing like a week ago. But thanks for the reply.
bro,when i try to fire it, IT ASCENDS UP TO THE HEAVENS . idk plz try to give me a solution.
This is da best tutorial ever
Thanks 😊
I followed all of the script and directions exactly and ckecked over it multiple times and yet the bullet doesnt fire.
The shooting is not working it is not showing up in the consol Please Help!
Did you ever get a fix??
@@TheOKGamerAF nope
how do i add sound effects
Failed to import package with error: Cannot import package in play mode.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) ???
I dont have the First Person template, what do i do?
Just in case you didn't work it out, or anyone else sees this issue (like I did). I found a package in the Asset store called "Starter Assets - First Person Character Controller | URP". So I created a new project of type "3D Core URP" and downloaded and imported this package. Then I removed the default scene from the hierarchy, and dragged in the scene called "Assets/StarterAssets/FirstPersonController/Scenes/Playground".
When I press left mouse button it does not show in the console and I cannot shoot either
Hey, im new to this stuff and i cant help but theres a Unity discord you can join with ppl that can help rlly easily
It’s fine now I found another tutorial but thanks for the suggestion
@@CKdunno hi I need a help ۔ ۔
@@Surgicalmushroom bro what tut? im still struggling lol
hi i get the error Assets/Scripts/Gun.cs(8,38):CS1002;expected. please help
me too i think im writing the code wrong
@@awesomecoolguyepicsocoolamI123 brooo same
@@awesomecoolguyepicsocoolamI123 my code is same but idk whats wrong
Debug.Log?
Please solve this,
My camera rotation is moving in only horizontal way
But not vertically
Start a new first person project in Unity with the fps sample pack then follow this tutorial
im having trouble, I cant put the sci fi gun under player camera root unless I do it in prefab
\
Unpack the prefab if you want
this is a great tutorial but i spent hours trying to fix bugs in the code where i mistyped and i was like "every single line of code is correct which one is it?" and both times it was a missing ; at the end...
You do realise that’s your fault right?
bro you are best in the world
i've got an issue Object referernce not set to an instance of an object . Tell me how can i fix this?
I am having same error. Need solution
Good work keep it up!
Thanks man
how do you select all the materials at once?
Shift + mouse left button
Can you please help me the Gun.Cs is not working i am getting meny errors. If possible can you copy and paste the code so i can use yours?
same problem
if you find a solution then please tell me.
Hi brother how are you I'm new subscriber I'm From India (Tamilnadu) Your video's good I'm like 🙋🤝 👍
Glad it was helpful 👍😀
Best tutorial in the world i learnd lit from it thx bro
guys if you have any errors just copy the whole code and paste it in chatgpt and done
chatgpt will fix the code
I don't think so, I have tried chat GPT and it makes some mistakes.
@@GDTitans I think ChatGPT is amazing but cannot process code that's too large
Question, I have a bug where it shoots, but the bullets go completly to the left, have encocountered this bug during the coding phase?
im pretty sure your bulletpoint is off
Thx bro! You saved my life@B4ttingOld
my bullets go backwards instead of forwards, what should I do?
Make bullet speed -600
@@FifaMobileShorts260 or just rotate the gun point at angle 180°
whenever i try to put the Gun C# scripts it says It cant add the component because the script class cannot be found. How do i fix this?
@Knight i dont understand lol
Make sure that the 'public class' is declared as 'public class Gun : MonoBehaviour', it's on top of the Gun C# script file
@@gabrielbatista1536 yeah i figured it out, but now it wont let me playtest
Is the part in Visual Studio required for it to work? My laptop won't support Mono so I can't open it.
You can use visual studio code its lightier than original one its 100 mb
7:18 naw bro didnt notice it said "GetChild"
Got anything on a weapon system brother?
I am making a overwatch 2 ultimax witch is a unofficial basically mugën but for fps but just overwatch
bro can you please make a video for fps microgame unity. it is working on pc but not on android controls. please make video that how to add android controls to microgame unity
Okay, I will try
my bullets only fall immediately after spawn, they don't fly far, what should I do?
Increase the force 💪 that is applied to the rigidbody
@@GDTitans How can i increase the force?
Hi! My bullets don't shoot. It shows in the console that the variable bulletPoint is not assigned in the Gun.Shoot() and Gun.Update(). I made everything exactly like in the video, but something is not right.
The reson is simple you have to add the bulletPoint gameObject we made to empty field of the gun's bullet point
please I know it an old video am gonna talk about but
in the FPS android Controller Setup video
you didn't put a button for weapon switching a
pretty please can you help me with that
Please
your voic is very comedy🤣🤣🤣🤣🤣🤣🤣🤣😂😂😂 realy your voice is comedy
😂😂
11:30
Wow, nice tutorial! How do I publish it?
Go ahead!
czcams.com/video/5ANuDZjhbFY/video.html
@@GDTitans thanks
which template is he using
Hey, I go to unity hub I can’t find the first person
You have to download it
i keep getting a cs1002 error on 21,24 but theres no problem with the code
@@Inperi you were right
@@TingunStudios you may erase that line
9:49 I dont see the bullet prefab on gun script I have perfectly copied the whole code from the vid what do I doooo aghhhhh :C
nevermind im a genius and fixed it :DDDDDDD
Great 👍
when i shot the bullet, the bullet fires into the right, how to fix it?
same buddy, same...
@@timeaverage change the bullet speed to negative, i had the same problem
@@CJ_Gamezz_YT pls show your game on yt when it's ✔️
i made some mistakes can you put the code in the describtion
whats the button to select all of the guntwo
How are you getting everything recommended in script in visual basic, I had to type everything myself? is there a setting I need to check?
same idk maybe his software just adapts or sum crap. idk. LOL
in unity go edit > preferences > external tools > choose visual studio for external script editor and press "regenerate project files" button below. After this close your visual studio and open it again and it should work
Can you open this game in an Oculus Quest 2?
I did the 999th like so if someone does it 1k then please make a video on how we can play our own game with friends
Here is the gun script (Pin this)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using StarterAssets;
public class Gun : MonoBehaviour
{
private StarterAssetsInputs _input;
// Start is called before the first frame update
void Start()
{
_input = transform.root.GetComponent(); // Fixed typo in GetComponent
}
// Update is called once per frame
void Update()
{
if (_input.shoot)
{
Shoot();
_input.shoot = false;
}
}
void Shoot()
{
Debug.Log("shoot!");
}
}
This script is the first gun script so you dont have to type every thing i might edit it so you dont have to do the shoot part either
is it c++ or what?
8:32
This is a great, simple, focused tutorial - describing how to download, import, and use a gun asset/prefab, how to get the gun barrel to follow the player "look", and how to shoot a "bullet" (which shows how to instantiate a prefab in code).
Only issue I have is that the gun barrel disappears into walls - anyone else see this issue?
its a common issue, there is a fix tho. Search it up on youtube. Its by making a seperate layer for your gun
this is common for most if not all games, the gun you see in your hand in games is usually just a picture of your gun, not your actual gun
It isnt shooting I have checked everything and it’s all the same but it ain’t shooting pls help
Update I think it has something to do with the input system
if u are using visual studio then make sure u save the code thats what i messed up on..
@@timeaverage I have already fixed it just started over and it worked after that
@@pffguy133 ok nice
hi i love your tutorial and i was wondering how can i add the shooting sound everytime i shoot?
Hello, you would just add logic after the bullet gets shot to play the sound.
probably doesnt know how@@Ultrapassive
I use model i made because i wanted to
How do you make the bullet move in a straight part and destroys on contact with an object
You would use a fast enough velocity or turn off gravity for the bullets. Then use a collider to detect the collision and delete the bullet after the collision.
What About rolly vortex game. Is it finished?
No I'm planning to add a video about admob ads with the shop system
@@GDTitans that would be so helpful sir
Bro,Your Video Is Like @Brackeys
And I Really Like This Fact...Can U Plz Make A Video On Multiplayer And Server UI And Menu UI
I HAVE A ERRORS
Assets\Scripts\Gun.cs(28,28): error CS1002: ; expected
Type of instance in array does not match expected type
UnityEngine.InputSystem.PlayerInput:OnDisable () (at Library/PackageCache/com.unity.inputsystem@1.4.2/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1734)
wat unity editor are you using
Please HELP I'm going crazy.... I'm trying to download the right version but I can't see the first person Template of the version you showing... I tried everything but it won't appear
You need to install a diffrent unity editor mine automatically downloade the 2022 version but you need to download the 2021.3.35f1 version
Thanks
😮😮😮 Super Nice 👍👍👍👍
i can not see the bullet , how can i fix that?
Can this be installed on phone?
Yeah
Bro I Have some problemss
I can’t find the first person option
You have to download it
cool video)
Thanks 😊