Unity FPS Course - Shooting Bullets

preview_player
Показать описание

Have you ever wanted to create your own version of Doom, Call of Duty or Half-Life?

Join us in this new course and have lots of fun building a first-person shooter game with Unity!

This course is project-based and covers all the main elements of games of this genre. After completing this course, you will have all the tools needed to program amazing games. These are some of the important skills you’ll be acquiring:

Implement and customize a production-ready First Person player controller.
FPS game mechanics: shooting, killing enemies, collision detection.
Save memory and CPU by implementing a reusable pool of objects.
Survive by finding health kits and ammo for you gun.
Enemy path finding AI using Nav Mesh.
Integrate external models and audio files.
Game workflow: Main menu, resetting game, game over and victory screens.
Рекомендации по теме
Комментарии
Автор

9:10
"It's going to make your life much much easier"
INDEEEED

aminmk
Автор

instead of a life timer it is better to have a set range and a vector3 known as spawn position stored in a start method
this way it goes the same range no matter the speed...
hope it helps
public float range;

public Vector3 spawnLocation;

public void Start()
{
spawnLocation = transform.position;
}
public void Update()
{
transform.position += transform.forward * speed * Time.deltaTime;

detectRange();
}

public void detectRange()
{
if(Vector3.Distance(spawnLocation, transform.position) > range)
{
Destroy(gameObject);
}
}

pandacatplayz
Автор

One of the few tutorial gems, well explained and simple. This is what I needed, Thank You!

ToonLikeEpic
Автор

very good, in internet it's hard to find simple fps shooting tutorials but this one is easy and functional (i ended up using my own code but using yours as a base)

lekrodrigo
Автор

If you set an empty object as the child of the gun you can use this as the firepoint, so that the bullet actually come out of the gun.

JMANTHEGERMAN
Автор

clap clap clap, nice tutorial man. (even though it didn't help me much). I like it because he actually explains the code. I have been watching so much tutorials and almost none of them actually explains the code except for brackeys.

dascience
Автор

workkkedd even in 2020 and a different program tyyy
thank you.

pyeeper
Автор

This is I was looking for thaaanks a million times! Great narration btw!

abidi
Автор

The lifetimer part at the end of the video, doesn't work.
After I shot the first bullet and it got destroyed within two seconds, I tried shooting another one but Unity said that I already destroyed that Game Object.

victorrus
Автор

i was looking for this! thanks! you voice is so calming tho!

cem
Автор

After the bullet is destroyed for me the game says “The object has been destroyed but you are still trying to access it” Do you know any work arounds?

santana
Автор

Btw I was using Vector3.forward instead of referencing the spawners transform.forward

Chevifier
Автор

Pretty handy! Appreciate the tutorial!

RobertMunteanu
Автор

Super tutorial thanks a lot it's so easy to understand

laurentbijman
Автор

9:14 it did indeed make my life a lot easier. THANK YOU

nullptryt
Автор

Thanks alot i had a problem with my previous script and this helped me fix it seriously appreciate it

joubran_
Автор

So if I placed the bullet on the muzzle of the gun, does it like shoot to the center of the screen or does it go straight. Cuz if it does i want the bullet to shoot accurately.

sparkeh
Автор

Not sure if this cofe existed back then but now to destroy a gameobject you can simply say

Destroy(this.gameObject, 2);

2 in this example being the time to remove the object

Chevifier
Автор

This is very helpful! You are a good man, Thank you.

phyzicsbrowning
Автор

So I repeated the code and watched this same video for a good three hours and I'm having trouble. Every time I click, the bullet gets cloned enough to fill the Hierarchy and no matter how slow I make the bullet speed, it just disappears as if it's going a million miles per hour. (Edit: I fixed it! I just missed the + before the = so instead of it being transform.position += transform.forward * speed * Time.deltaTime; it was just transform.position = transform.forward * speed * Time.deltaTime;)

dementedgears