Тёмный

2D Top Down Shooting POINT & CLICK Unity Tutorial 

BMo
Подписаться 31 тыс.
Просмотров 40 тыс.
50% 1

In this Unity Tutorial we're building off what we did last tutorial in setting up our 2D Top Down Movement project and expanding it to now include 2D Top down shooting mechanics.
There are a few different User Experiences for handling shooting from a top down perspective, in this tutorial we focus on a point and shoot approach which is driven by aiming with the mouse and firing with left mouse button.
By the end of the tutorial you'll have the structure of firing projectiles in any direction down, but I challenge you to expand upon it and figure out how to flesh out the weapon and bullet scripts to be more interesting in your own games.
If you have any PROBLEMS or want to share PROGRESS / Talk ideas, think about joining the new community discord!! (linked below)
There is a problem-solving discord channel where you can post any errors you're getting and the community will help you out.
➤WATCH PART 1 - 2D Topdown Movement Tutorial: • 2D Top Down Movement U...
✨Want to support the channel?
Buy me a coffee ☕: ko-fi.com/bmoli
➤Join the new DISCORD SERVER: / discord
➤Want to make video games? Start with my tutorial Playlist: • Epic Unity Tutorials
➤5 Minute Tutorial Series: • 5 Minute Games
➤Don't forget to SUBSCRIBE for all the upcoming content.
THANK YOU!
#bmo #unity #tutorial

Опубликовано:

 

8 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 92   
@revmatch6r
@revmatch6r 4 года назад
Love it. That would have taken me so much longer to figure out than 13 minutes
@BMoDev
@BMoDev 4 года назад
Appreciate it!
@EchoYoutube
@EchoYoutube 3 года назад
If your having a problem with the "NullReferenceException: Object reference not set to an instance of an object" error, roughly around when you make the player shoot for the first time, heres how to fix it. This error means that something outside of the code is not being referenced. Usually, when there is an error with the code it wont allow the game to run. If the game is going, but you only get the error when you shoot, that means the reference hasnt been set OUTSIDE of the code. Simply put, just go to your player(or whatever is making the error) and make sure everything is synced up with your scripts.
@jayd1os400
@jayd1os400 3 года назад
I get this error but what do you mean by synced up with your scripts???
@carmenjuliarodriguez3221
@carmenjuliarodriguez3221 3 года назад
Thank you so much. I needed that.
@sea-jae6237
@sea-jae6237 3 года назад
THANK YOU!!!!!!
@stryc.
@stryc. Год назад
Thank you!
@TurningTrix42
@TurningTrix42 Год назад
I love you and want to marry you. Thank you.
@stalkerdeb900
@stalkerdeb900 4 года назад
Are you planning on making a Video about Enemie Interactions and Health usw? That would be great! Your tutorials are super great btw! Have a good Day, Byeeee!
@BMoDev
@BMoDev 4 года назад
Yup, that's definitely going to get covered soon!
@thomasedwardking7286
@thomasedwardking7286 Год назад
So clear and accessible. So much learnt here. Thankyou
@mattthebanana
@mattthebanana 4 года назад
Please do a top-down melee tutorial
@BMoDev
@BMoDev 4 года назад
that is definitely in my backlog!
@jimmyljr95
@jimmyljr95 4 года назад
Nice tutorial! I was wondering how this would work for a mobile game? What are your thoughts on this, can you show us? Thanks again!
@BMoDev
@BMoDev 4 года назад
It'd be pretty easy, instead of checking if you're pressing the mouse button, you could detect tapping on the screen, record the position and register it as a "mouse click". Unity comes with mobile integration, but I probably won't cover it for a bit... eventually tho
@eileeng2492
@eileeng2492 3 года назад
This is a really great vid man.
@l8j951
@l8j951 4 года назад
Nice
@BMoDev
@BMoDev 4 года назад
Very nice
@wandevv
@wandevv Год назад
The VS code theme you are using is amazing, what is the name?
@MitchIcarus
@MitchIcarus 3 года назад
at 7:13 I get the following error in my console: NullReferenceException: Object reference not set to an instance of an object PlayerController.ProcessInputs () (at Assets/PlayerController.cs:33) PlayerController.Update () (at Assets/PlayerController.cs:18) line 33 is my weapon.Fire(); code, line 18 is ProcessInputs(); any help?
@MitchIcarus
@MitchIcarus 3 года назад
UPDATE: I fixed it I guess? I clicked on my player, and then dragged my weapon in the weapon slot under Player Controller (Script). Is that how I was suppose to fix it?
@pugbread2873
@pugbread2873 3 года назад
@@MitchIcarus thank you! had the same problem and this worked
@aquamoko0664
@aquamoko0664 3 года назад
Tysm i sas stuck with this problem for a whole day t’y (:
@neatelf9913
@neatelf9913 2 года назад
@@MitchIcarus This worked. This FUCKING worked. If someone who's reading this is using a private GameObject for Weapon instead of public, just use [SerializeField] above/before the object declaration and it will show up in the Inspector. e.g: [SerializeField] private Weapon weapon;
@Kai-ss8ke
@Kai-ss8ke 3 года назад
Could you show me how to use the particles you used?
@homosexualitymydearwatson4109
@homosexualitymydearwatson4109 3 года назад
Thank you so much I have adhd and learning from RU-vid is really hard for me but your videos are easier to learn from, could you Maybe do a video series teaching certain essentials of coding with unity? I’m currently learning (and have experience in Python from my last semester course) C++ in my college class so most of it is familiar to me , but I’d really love to see you explain a little more in depth with the code?
@Great-Dao-of-Elegance
@Great-Dao-of-Elegance 9 месяцев назад
How can I have a different gameobject rotate instead of the player and shoot as well
@flukeycups4502
@flukeycups4502 Год назад
How to get the particle system 12:56 (the one that you dragged into the ImpactEffect). Do we need to download from outside source? And do we need to set up anything on it?
@darkflame2848
@darkflame2848 3 года назад
Plz help id doenot rotate properly it rotates half than it auto rotate to its place help
@oshimaboyd1919
@oshimaboyd1919 2 года назад
Could you make a tutorial on Top Down shooting using arrow keys instead of mouse?
@tirilmariepedersen6956
@tirilmariepedersen6956 Год назад
Yeeeeees, would love that!!!! C:
@nickvullings8728
@nickvullings8728 3 года назад
Is there a way to add delay between each shot so my pistol doesnt shoot a beam of bullets when i hold m1
@salimmoughrabi603
@salimmoughrabi603 3 года назад
very nice vid man . can you plz make a tutorial where you combine this mechanic and the 8d movement (in your 8d animation vid) so that we get mechanics just like enter the gungeon. im still new to coding and liked your content easy to understand keep it up .
@billdam7298
@billdam7298 10 месяцев назад
How do I make something other than the player rotate and move along with the player (E.g. a blaster of sorts)?
@actualartificer223
@actualartificer223 7 месяцев назад
make it a child of the player and it should work
@domenzigart50
@domenzigart50 2 года назад
for some reason my rb.rotation = aimAngle; doesn't work, It says "=" and ";" are used incorrectly, can you please help
@henrrypoop7570
@henrrypoop7570 4 года назад
wow
@Bignose_Dev
@Bignose_Dev 3 года назад
my player didint have collision why ?
@thenoglinman
@thenoglinman 2 года назад
Hi, any thoughts on making a melee version of this. That would really help!
@AlexGorskov
@AlexGorskov 2 года назад
yeah
@cardario5323
@cardario5323 2 года назад
brackeys has a viedo about it you can check it out!
@Yovry
@Yovry 2 года назад
Damn. I'm trying to find a tutorial JUST LIKE THIS for ue4 lol
@rido3753
@rido3753 6 месяцев назад
seeing the left side of your screen would have been helpful
@vvcephie113
@vvcephie113 3 года назад
is ther anything wrong with this, It says Missing ";" } } void OnTriggerEnter2D(Collider2D other){ if(other.CompareTag("Player")); or if(other.CompareTag("Walls")); { DestroyProjectile(); } }
@BMoDev
@BMoDev 3 года назад
yup, compare your if statement to the one in the video
@vvcephie113
@vvcephie113 3 года назад
@@BMoDev Thanks!
@vvcephie113
@vvcephie113 3 года назад
Could You make a vid about the enemy heath scrip??? I am just learning unity and code. If you could that would be great!
@ashako506
@ashako506 2 года назад
my bullet just goes to the right of the gun how do i fix this?
@Wittlson
@Wittlson 2 года назад
make sure you do -90 at aimAngle
@l.1263
@l.1263 3 года назад
When I move my mouse why does my character move in like massive circles
@minecraftwithjpizza9929
@minecraftwithjpizza9929 3 года назад
My bullet goes up not forwards
@gusevgp1417
@gusevgp1417 3 года назад
it says that the mousePosition doesnt exist even if I did the correct code (mousePosition = sceneCamera.ScreenToWorldPoint(Input.mousePosition);) how can I fix this/ can someone send me a copy, cuz I can't get this to work for the life of me
@BMoDev
@BMoDev 3 года назад
looks like the semicolon has to be outside of both )), like (mousePosition = sceneCamera.ScreenToWorldPoint(Input.mousePosition));
@gusevgp1417
@gusevgp1417 3 года назад
@@BMoDev I added a second bracket as in "hi, I'm jim (jim jones), nice to meet you."
@mischa8517
@mischa8517 3 года назад
so why do you have to do -90 at the aim angle
@Lps-bx7ck
@Lps-bx7ck 2 года назад
Because if you don't, he will shoot to his right (polar angle 0). When you subtract 90 degrees, it is rotating the cube clockwise, which means the top of the cube is the shooting direction. Then it corrects to the mouse position.
@jmbrjmbr2397
@jmbrjmbr2397 2 года назад
I don't get it too, I'm confused
@user-mp4bu5rd6b
@user-mp4bu5rd6b Год назад
How can i make the camera follow the player
@BMoDev
@BMoDev Год назад
Theres quite a few ways but checkout my Cinemachine tutorial
@user-mp4bu5rd6b
@user-mp4bu5rd6b Год назад
@@BMoDev alr thank you
@decentanims
@decentanims Год назад
Help! There was a error that said "Assets\PlayerController.cs(10,12): error CS0246: The type or namespace name 'Weapon' could not be found (are you missing a using directive or an assembly reference?)", it errored at my script " public Weapon weapon;" any help?
@soapypenguin631
@soapypenguin631 Год назад
you need to assign the script to it in the editor, as well as making sure your script is named "Weapon"
@crashcode2401
@crashcode2401 3 года назад
WHERE IS PART ONE? Still looking for the first Video part ... XD
@DeadeyeOutdoorman
@DeadeyeOutdoorman 2 года назад
Is anyone else having issues with the OnTriggerEnter2d not triggering?
@BMoDev
@BMoDev 2 года назад
Make sure spelling/capitalizations correct. Make sure IsTrigger is checked in inspector on your Collider2D component
@DeadeyeOutdoorman
@DeadeyeOutdoorman 2 года назад
@@BMoDev I'm using visual studio code and simply needed to add the Unity Code Snippets Extension, thank you.
@providedmoney4722
@providedmoney4722 3 года назад
I try the movement but my cube just move very weird. Can you help me?
@moolayenstudios
@moolayenstudios 3 года назад
Is your character only rotating toward one spot in the center of your camera?
@nameisian
@nameisian 2 года назад
@@moolayenstudios yes plz help
@GGG-hh5jo
@GGG-hh5jo 3 года назад
I did all your tutorials but stuck at 6:34 I click the Right button it won't Help!
@carmenjuliarodriguez3221
@carmenjuliarodriguez3221 3 года назад
Me too.
@ciaranmccallion8264
@ciaranmccallion8264 Год назад
me thinking i was smart making the player the cameras parents so the camera follows me around only to have that fuck up the rotation
@darshnagdeve4021
@darshnagdeve4021 3 года назад
what should i do when the bullet is not moving
@darshnagdeve4021
@darshnagdeve4021 3 года назад
what should i do if the bullet is going up
@maxxxxiors
@maxxxxiors 3 года назад
what should i do if the bullet is falling down
@DertyDub
@DertyDub 2 года назад
3:49
@umanathification
@umanathification 4 года назад
Why aren't we funding this?
@DertyDub
@DertyDub 2 года назад
6:01
@DertyDub
@DertyDub 2 года назад
7:36
Далее
2D Animation with Blend Trees Unity Tutorial
19:53
Просмотров 34 тыс.
TOP DOWN MOVEMENT in Unity!
22:30
Просмотров 1,2 млн
Modus males sekolah
00:14
Просмотров 12 млн
POV: Your kids ask to play the claw machine
00:20
Просмотров 9 млн
2D Top Down Movement UNITY Tutorial
7:21
Просмотров 222 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 4 млн
How I Made a 3D Platformer in 2D Game Engine
21:23
Просмотров 483 тыс.
The Most Impressive Scratch Projects
11:00
Просмотров 4,9 млн
2D CHARACTER CUSTOMIZATION in Unity Tutorial
14:49
Просмотров 127 тыс.
How I made an Excellent Platformer
8:25
Просмотров 275 тыс.
Modus males sekolah
00:14
Просмотров 12 млн