"A quick 2d top-down fps game" Top down AND First person? Impressive 👍
@BMoDev2 жыл бұрын
hahah thats right, we break boundaries here
@StandardArrayOfficial2 жыл бұрын
Dang it You beat me to the joke lol
@Hamlet26152 жыл бұрын
Yup that’s right
@iiropeltonen2 жыл бұрын
I recently discovered your channel and have already watched propably everything you've made. Excellent content. I've only recently begun practising C# and Unity and this is the perfect level for me. I like to check tutorials like yours while I'm trying to figure out something on my own to see if someone experienced has a better solution than what I was thinking and also so learn stuff that I don't know yet. Your scriptable object videos have been very enlightening. Reasons why I think your videocontent is great 1.) Short and compact explanation of "How to" 2.) Explanation of underlying principles 3.) Typing out code while explaining the system as it builds up. 4.) Perfect pace for beginner / intermediate. 5. Occasionally funny. You remind me alot about Brackies and that is by any standard a good thing.
@VoxelsmithGaming2 жыл бұрын
This is the best tutorial i ever seen, short, informative and totaly awesome!
@Captain-Jinn2 ай бұрын
For someone coming back to development as a hobby after a long hiatus this was the perfect cold splash of recognizable code to get me back in the saddle. Thanks BMo!
@SchizoetryOfficial2 жыл бұрын
Took me an hour to do what you did in 5 minutes lmao had to keep pausing and rewinding and since you went so fast I made like 25 different errors to fix because I can't type fast haha good work though you're the fastest coder in the west
@justaraimbowslime7041 Жыл бұрын
My man made a unity tutorial speedrun wr
@adeled88332 жыл бұрын
if the bullet doesnt destroy, then it might overload memory(?) using System.Collections; using System.Collections.Generic; using UnityEngine; public class Bullet : MonoBehaviour { public float timeToLiveBullets = 2f; void Start() { Destroy(gameObject, timeToLiveBullets);; } }
@mtyuiop072 жыл бұрын
Thanks, I was searching for this!
@SunWarriorSolaire Жыл бұрын
it already destroys, i think you mean if the bullet is shot into somewhere far away
@adeled8833 Жыл бұрын
@@SunWarriorSolaire idk maybe there was a piece of code I skipped. It didn’t destroy on its own
@SunWarriorSolaire Жыл бұрын
@@adeled8833 in the bullet prefab it said if it hits something, destroy itself
@elias-ee9kn Жыл бұрын
@@SunWarriorSolaire if you dont hit something the bullets dont destroy wich could overload the memory over time
@fredrc17432 жыл бұрын
This tutorial was amazing! Keep up the good work c:
@03codey Жыл бұрын
Made 1 year ago but I needed this today, thank you for taking the time to do this!
@michelemehelean172 жыл бұрын
Your videos motivate me to keep learning. Thank you for your tutorials!
@n1njafish894 Жыл бұрын
Hey, just discovered your channel, and how quickly and clearly you conveyed the code to us is actually amazing
@Dethshoot1 Жыл бұрын
Super great tutorial. Nice homework exercise for anyone doing this is to follow up by implementing an object pool for the bullets.
@kyleandersen23882 жыл бұрын
The Unity God Has Answered!
@EasyGetFreezy2 жыл бұрын
WOW, this is even better than Udemy tutorials. Good job
@GingerNingerish2 жыл бұрын
This is a really good Game Jam quickstart guide.
@speakik9377 Жыл бұрын
How to make it so that the player does not go vertically and horizontally, but on W it goes where the mouse is? PLEASE someone help.
@jakub_rotter2 жыл бұрын
Could you make ammo/reload system for this too? Amazing video btw
@mattallenclosedforum95052 жыл бұрын
I don't know if you are taking requests but I was wondering if you have any plans for a video on top down enemies avoiding walls, collisions and obstacles as I just can't figure it out.
@spounka2 жыл бұрын
A* pathfinding algorithm is your friend
@dryzoFy Жыл бұрын
i llove men with a mustache with a 3 letter name with 2 caps with 21.7k subs rn with his face zommed in as his pfp that makes 5 minutes videos about unity
@matijastanivukovic8744 Жыл бұрын
PLEASE someone help me. I cannot for the love of me figure out the problem. I can't shoot the bullet when just pointing in one direction. Only when I constantly spin the Player around does the bullet fire. When I just look at one direction, the Player object moves slightly to its right. I checked the ENTIRE code and its the same as in the video. I just edited the code from the old tutorial to the new one.
@Seshua87 Жыл бұрын
Probably better to have the prefab destroy itself after a short delay, because if it doesn't hit a collider then it will just continue to exist, and if you're shooting tons of them.... easy fix - In the Bullet script add a float, I called mine destroyDelay = 1.0f; Then create a: private void Awake() { StartCoroutine(RemoveProjectile(destroyDelay)); } IEnumerator RemoveProjectile(float delayVar) { yield return new WaitForSeconds(delayVar); Destroy(gameObject); } This will make it destroy the bullet after your destroyDelay variable amount or if it hits a collider it will destroy itself.
@Crazyfamlam2 жыл бұрын
Thank you so much this was the only shooting tutorial that worked for me
@cursedkennedy7605 Жыл бұрын
Same, but I think I finally figured out why some my scripts won't work.... This video made me notice something... In public and private voids and active it must exactly have the same name as the empty containers you make and every empty you create in your hierarchy must have a same name script... So when he wrote Weapon Weapon it worked. I've been to complicated try naming everything 001 or a or some unnecessary shit
@mharris15273 ай бұрын
Following the tutorial my bullet does not move only sits in position, what am I missing?
@bandanadev658 ай бұрын
Thank You so Much My Friend. I First Saw The brakeys Tutorial, but that didn't work, You ARE my Saviour.......
@awesome_billy_bob Жыл бұрын
could you post the c# code in the description, it doesn't seem to work for me. Thanks!
@oOAjjOo2 жыл бұрын
How would you go about making the rb rotate with a button press? Like what if I want to aim with arrowkeys and move with wasd?
@Enkeria6 ай бұрын
Neat. Is there any similar tutorial to UE?
@Carlos-Garcia47 Жыл бұрын
When I clicked on weapon I wasn't able to add the bulletprefab or the fire point why is that? I followed the tutorial perfectly but it didn't work
@ProfessorCD_y Жыл бұрын
How do you open up that menu for the player controller at 1:22
@LargePotatooooo2 жыл бұрын
i am incredibly new to unity, i specifically got it just to make a top down shooter. but, since im new, i think my settings are way off from what they should be. basically, the drag and drop values like the move speed or the weapon, dont appear on my screen when i collapse the scripts, do you have any idea as to what i may be doing wrong here?
@yaboishadowninja2 жыл бұрын
Try putting [SerializeField] in front of the variables
@ItzRigby_ Жыл бұрын
are they public variables?
@MusicalMarble Жыл бұрын
How can you do the same thing, but side scrolling left to right like U.N. Squadron?
@Bobbyttfnn Жыл бұрын
i typed it exactly like you did and it just says Weapon could not be found
@joepspaanjaars1435 Жыл бұрын
Does someone know with what class i can replace the "Weapon" class in the playermovement script? Unity doesn't like it. If i use "public GameObject weapon" and then "weapon.Fire();" it gives an error immediately.
@jamesMcroy12 Жыл бұрын
It gives that error until you create the FIre method in the weapon script, which you do in the next step
@joepspaanjaars1435 Жыл бұрын
@@jamesMcroy12 thanks! I figured it out tho
@Carlos-Garcia47 Жыл бұрын
The player control was giving me errors something about Rigidbody2D does not contain a definition for Velocity and no accessible method Velocity
@Cgtchilly Жыл бұрын
Assets\PLayerController.cs(9,12): error CS0246: The type or namespace name 'Weapon' could not be found (are you missing a using directive or an assembly reference?)
@francisbond5605 Жыл бұрын
PLEASE PLEASE PLEASE HELP! 4:39 I tried to do this, but there was no place to drag in the prefab, no matter what I tried, I have no idea what to do, someone, anyone, please. :( In fact I can't drag anything into any script. please
@HalfTangible Жыл бұрын
My firepoint rotates in place, rather than around the character. Is this a common thing/easy fix?
@cursedkennedy7605 Жыл бұрын
I want make multiple weapons like a machine gun turret (default weapon), a cannon turret, and a missile launcher. Where you can use all three with different key presses, but I also want it so that the weapons are upgradable or you can replace missile types (like normal missile, long range, homing, ect..) can this script be modified to something like that?
@nearraindrop11611 ай бұрын
Anything is possible if you have the knowledge! I would recommend finding a few tutorials on just normal fps weapons and try to apply what you learn from that into your script
@mazking1366 Жыл бұрын
When my bullets hit the enemy, it makes it bounce all around the screen.
@Sam4Progress9 ай бұрын
The fact he did it in LESS than 5 minutes, while explaining what was going on....
@legendaryfasteddy2 жыл бұрын
hmmm I have drift,....to where the pointer is...and the bullets don't move.
@piotrduda80302 жыл бұрын
what version if visual studio are you using? i think mine is outdated
@Rubycore Жыл бұрын
When I press play I only see the blue background
@thecybersecurityexperience2758 ай бұрын
What game is on the thumbnail?
@plybot Жыл бұрын
will this work with unity 2019? (school computers only have unity 2019 :/ ) and how do you get those fancy suggestions that autofill some code in? thanks and i will 100% be using this in my programming class! (if i can remember it all xD)
@dexterity4949 ай бұрын
Autofill is likely with a third party program like visual studio
@abg24872 жыл бұрын
How to make game object blink ie on and off using couroutine?
@funnyvalentine87382 жыл бұрын
How can I "tie" maincam to player? If I put it in player, all of these scripts don't work
@garaylemonade1020 Жыл бұрын
what vs theme are you using? looks nice
@OGSilentMan9 ай бұрын
dark mode i think
@henapbc9 Жыл бұрын
You wrote you'll ask any questions so: Can I somehow attach the camera to the player without getting everything spinning around me like crazy?
@mrniceguy8298 Жыл бұрын
maybe attach the camera with rigidbody2d dynamic and make sure to it has zero gravity
@juliaalder20072 жыл бұрын
This is amazing! 🥳 Could you do this with the new Input System?
@DragonPox902102 жыл бұрын
How do I get the bullet to ignore certain colliders? I followed along to your collectible magnet tutorial but the bullet deletes itself when it hits the magnet collider
@Sniiiface2 жыл бұрын
Could try to add a if(other.tag) and make a magnet tag, then if the collision is with a maget add a {return}
@leonardocarolo6961 Жыл бұрын
A bit late but in the Collision matrix you just disable the collision interactions you want
@sashax2845 Жыл бұрын
Awesom guide!
@pffguy133 Жыл бұрын
The error “assets\scripts\playercontroller.cd(25,51): error CS1002: ; expected” and I don’t know how to fix it I have looked at the code more than 5 times and it’s just not working pls help
@mynameisearlbАй бұрын
The error is literally telling you that you are missing a semicolon ; somewhere.
@okajnsd8071qhduipjanskd2 жыл бұрын
What coding system do you use i use VS code and i dont get all the fancy things where it shows me the little cheat sheets for what i can type in for code?
@dhanveersolanki1604 Жыл бұрын
Visual Studio Community
@Santosos255 Жыл бұрын
@@dhanveersolanki1604 thats nit a language
@WallDotCom2 жыл бұрын
Why does the weapon namespace not work
@ChuckDuck. Жыл бұрын
What do you use to edit your code in the video
@OGSilentMan9 ай бұрын
Visual Studio Code
@joujwbass9 ай бұрын
PlayerController script dont work for me
@Kaaxe Жыл бұрын
my constructive criticism for this and most tutorials is to please use time stamps for the timeline
@UnisRapier2 жыл бұрын
my plyer slides a little bit when moving how to prvent that?
@oggie37212 жыл бұрын
Turn of gravity on the rigidbody2D component
@decentanims2 жыл бұрын
When i move my mouse it doesnt rotate and follow my mouse, can anyone answer the problem?
@codingrelaxation45442 жыл бұрын
I have a huge problem for some reason the player doesn't follow the mouse, like i have no errors and everything else works fine except that please someone help me here's my script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerController : MonoBehaviour { public float moveSpeed; public Rigidbody2D rb; public Weapon weapon; Vector2 mousePosition; Vector2 moveDirection; // Update is called once per frame void Update() { float moveX = Input.GetAxisRaw("Horizontal"); float moveY = Input.GetAxisRaw("Vertical"); if(Input.GetMouseButtonDown(0)) { weapon.Fire(); } moveDirection = new Vector2(moveX, moveY).normalized; mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); } private void FixedUpdate() { rb.velocity = new Vector2(moveDirection.x * moveSpeed, moveDirection.y * moveSpeed); Vector2 aimDirection = mousePosition - rb.position; float aimAngle = Mathf.Atan2(aimDirection.y, aimDirection.x) * Mathf.Rad2Deg - 90f; } }
@beefyikes67902 жыл бұрын
I may be too late but you forgot to add rb.rotation = aimAngle;
@decentanims2 жыл бұрын
@@beefyikes6790 When i did that it only rotated when i pressed w a s d
@Sallyisntadog9 ай бұрын
thanks im tryna recreate a game that i cant find anywhere
@pureac33372 жыл бұрын
Anyone know why? on 2:31 he says "fixedUpdate" and some text pops up. That doesnt work for me tho. Anyone know why?
@dhanveersolanki1604 Жыл бұрын
It is like AutoCorrect
@dhanveersolanki1604 Жыл бұрын
I think its only for Visual Studio Community
@Stompin402 жыл бұрын
Haha this is awesome!!!!!!!!
@josefstalin35682 жыл бұрын
It says theres no definition for fire?
@suicune20012 жыл бұрын
Awesome!
@SmokingToaster73718 күн бұрын
the weapopn doesn't follow the cursor and the player
@Saladon89 Жыл бұрын
Nice, thank you
@KarbidoweDzialoPlanetarne Жыл бұрын
what is difference bbetwen update and fixedUpdate?
@scjohnson243 Жыл бұрын
Update runs once per frame, Fixedupdate can run 0 or multiple times. Fixedupdate runs with the physics engine, so anything using a rigidbody is a good canidate to be put into FixedUpdate - Update can miss frames if there is a lot of processing going on.
@FreStyler3644 Жыл бұрын
Hello I'm looking for old game on windows, i remember only graphic is like GTA2 top down, But there is only shooting from cars guns, grenades, bazooka. one map is like Texas on the desert, Story was about Revenge on Gangsters for Brother death, every boss death had scene, last boss look is Long blonde hair mustache and last boss ending: he is half death and was doused in Tequila and set on fire
@navy30012 жыл бұрын
object pooling is better then creating / destroying objects... When i did that swap, I gained about 25 FPS for my game.
@OKayD3N2 жыл бұрын
I tried implementing it but idk how to properly attach it to the weapon script
@fumomofumosarum58932 жыл бұрын
seeing the mumbo-jumbo programming makes me want to give up before i even began... x__x
@HaydenTheJayden5 ай бұрын
Super helpful
@animationsbelike2 жыл бұрын
Thank you! :D
@anonyanony7469 Жыл бұрын
Nice tuts for the beginer.
@crackheadgamer9880 Жыл бұрын
im getting so many errors fuck i dont know how u quickly do the tab things and the invisable dots ur colours are dif than me how do i fix that
@saenkoandrew2 жыл бұрын
Please maske same video for Mobile Devices Control!
@Sh1zle703 Жыл бұрын
good tutorial but you were a little too fast for me
@ThatJaMzGuy Жыл бұрын
trying do this 3d with cubes lol fun and pain....mostly just pain
@jaydenvogtvogt54652 жыл бұрын
Hey my bullet Not fire
@Yayboo2 жыл бұрын
Tysm!
@SuperVannini2 жыл бұрын
Amazing
@timonenluca4live2 жыл бұрын
I think the biggest issue i have with game development for the first time is sitting there on a scripting API hoping to find a function you need. Like for me that is literally 75% off my time spend , you know exactly what to do and what you need only to sit there thinking what the fuck is the function for this shit?
@dashadventure99522 жыл бұрын
Yes
@Cgtchilly Жыл бұрын
none of it works for me
@realng46112 ай бұрын
0.25 speed and watched for 4 times
@KraktysAncientAccount Жыл бұрын
I really want to create games but am too stupid to write code so I have ChatGPT do it for me 😅
@ftrwar6 күн бұрын
lol that was pretty cool lol
@not_rayane Жыл бұрын
you sped run bro you forget the timer
@bobsterlobster1248 Жыл бұрын
Slow down bro
@thelostfoundtheatre95602 жыл бұрын
i put in the code, but my player doesnt move, and i dont have any errors. heres my code (i edited the weapon variable to pistol so i can add more weapons later) using System.Collections; using System.Collections.Generic; using UnityEngine; public class playermovement : MonoBehaviour { public float moveSpeed; public Rigidbody2D rb; public Pistol pistol; Vector2 mousePosition; Vector2 moveDirection; // Update is called once per frame void Update() { float moveX = Input.GetAxisRaw("Horizontal"); float moveY = Input.GetAxisRaw("Vertical"); if (Input.GetMouseButtonDown(0)) { pistol.Fire(); } moveDirection = new Vector2(moveX, moveY).normalized; mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); } private void FixedUpdate() { rb.velocity = new Vector2(moveDirection.x * moveSpeed, moveDirection.y * moveSpeed); Vector2 aimDirection = mousePosition - rb.position; float aimAngle = Mathf.Atan2(aimDirection.y, aimDirection.x) * Mathf.Rad2Deg - 90f; rb.rotation = aimAngle; } }
@BMoDev2 жыл бұрын
Is your script attached to the gameobject and components wired in the inspector with a movespeed set?
@bsdpowa6 ай бұрын
stop saying game when you mean demo
@SZTUKAHARDKORU2 жыл бұрын
probably most annoying speech type u can hear in a video tutorial
@har3nz Жыл бұрын
BRo what is that public Weapon weapon; wtffff it gives an error what kind of thing even is that supposed to be how is it supposed to work in the first place
@Doxedius2 жыл бұрын
Guys I need help. i have this error and i dont know how to fix it: cannot convert from 'UnityEngine.Quaternion' to 'UnityEngine.Vector3' And the error is in Weapon And heres the code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class Weapon : MonoBehaviour { public GameObject bulletPrefab; public Transform firePoint; public float fireForce = 20f; public void Fire() { GameObject bullet = Instantiate(bulletPrefab, firePoint.rotation, firePoint.rotation); bullet.GetComponent().AddForce(firePoint.up * fireForce, ForceMode2D.Impulse); } }
@XnathOW2 жыл бұрын
Always check the line the error is on. You've probably solved this already, but your Instantiate has 2x rotation, when Instantiate needs firePoint.position + firePoint.rotation
@Mqto64 Жыл бұрын
I've been getting this error non-stop, "Assets\playerMovement.cs(9,12): error CSO246: The type or namespace name 'GUN? could not be found (are you missing a using directive or an assembly reference?)", here's my code if anyone has a clue why it's happening: using System.Collections; using System.Collections.Generic; using UnityEngine; public class playerMovement : MonoBehaviour { public float moveSpeed = 3f; public Rigidbody2D rb; public GUN gun; Vector2 moveDirection; Vector2 mouseposition; //Update is called once per frame void update() { float moveX = Input.GetAxisRaw("Horizontal"); float moveY = Input.GetAxisRaw("Vertical"); if(Input.GetMouseButtonDown(0)) { gun.Fire(); } moveDirection = new Vector2(moveX, moveY).normalized; mouseposition = Camera.main.ScreenToWorldPoint(Input.mousePosition); } private void FixedUpdate() { rb.velocity = new Vector2(moveDirection.x* moveSpeed, moveDirection.y* moveSpeed); Vector2 aimDirection = mouseposition - rb.position; float aimAngle = Mathf.Atan2(aimDirection.y, aimDirection.x) * Mathf.Rad2Deg - 90f; rb.rotation = aimAngle; } }
@ttc_antigamer4ever2194 ай бұрын
i know its a little to late, but maybe its because you wrote GUN in all Capital, and if i remember it right, this coukd be a problem, maybe write Gun instead of GUN but i could be wrong also... so dont expect it to work perfectly, but please try it atleast
@russeleinsla Жыл бұрын
How come i cant find bullet prefab in the script as a property