TOP DOWN SHOOTING in Unity

  Рет қаралды 876,781

Brackeys

Brackeys

Күн бұрын

Пікірлер: 1 500
@Danidev
@Danidev 5 жыл бұрын
Whoah hello there handsome are you new around here??
@gaslightingbruh
@gaslightingbruh 5 жыл бұрын
Hej dani
@gaslightingbruh
@gaslightingbruh 5 жыл бұрын
Im your fan
@gaslightingbruh
@gaslightingbruh 5 жыл бұрын
Can i ask you something
@gaslightingbruh
@gaslightingbruh 5 жыл бұрын
Dani can you pls help me about changing 2d characters on buttons. But that they are on diferent scene. Like you are on character scene and they are changing in game scene
@gaslightingbruh
@gaslightingbruh 5 жыл бұрын
Pls help
@sykoo
@sykoo 5 жыл бұрын
AHHHH YOUR HAIR!! I was like "ah neat they hired a new guy at Brackeys!"
@cafafifa9663
@cafafifa9663 5 жыл бұрын
Sykoo Hahaha same!!!!! Love your content Sykoo
@unlockener
@unlockener 5 жыл бұрын
Breathtaking hair
@sykoo
@sykoo 5 жыл бұрын
@@unlockener omg perfect joke for this scenario lol... now we just wait for Asbjörn to reply with "You're breathtaking", and our mission is completed bois
5 жыл бұрын
When ur scrolling brackeys comments and you find golden unity channel 😍
@CreativeSteve69
@CreativeSteve69 5 жыл бұрын
syko that is what i thought whie watching this video too. i gotta admit he does look good with this length of hair though. also love your videos too sykoo.
@josephpizzati8325
@josephpizzati8325 4 жыл бұрын
I love how genuinly excited Brackeys gets with something like a bullet shooting out.. he's probably written a similar script to that a million times but still acts like its the first time he has ever done it... ahhaaha love him
@bloodyblue354
@bloodyblue354 4 жыл бұрын
IF YOUR CHARACTER IS ALWAYS LOOKING AT THE CENTER OF THE SCREEN (or some other fixed point) and not rotating towards your mouse cursor, change the camera to ORTHOGRAPHIC. By default the main camera seems to be set to PERSPECTIVE which adds a Z component into the mix which isn't handled by the code shown in this video.
@minimoose5119
@minimoose5119 4 жыл бұрын
omg thank you sooooooo much you just saved me from total failure in a game jam
@null.zipped
@null.zipped 4 жыл бұрын
This dident work for me :( Edit:I found the problem turns out i was just stupid
@Zaxoosh
@Zaxoosh 4 жыл бұрын
Amazing LEGEND!
@loganwynia1008
@loganwynia1008 4 жыл бұрын
Thank you
@rufusmassey899
@rufusmassey899 4 жыл бұрын
Thanks so much man, was stuck on this for like hours
@silentminecrafter6234
@silentminecrafter6234 5 жыл бұрын
Brackeys is nice, easily understood, and his tutorials are great.
@juschu85
@juschu85 5 жыл бұрын
There are rumors that those bullets that exited the screen without any collision are still flying around these days.
@Glori4n
@Glori4n 5 жыл бұрын
Actually, they all get deleted once you leave the play test :)
@aisforanimate4703
@aisforanimate4703 5 жыл бұрын
R/whoosh
@aisforanimate4703
@aisforanimate4703 5 жыл бұрын
*I've always wanted to say that*
@aidangalbraith1904
@aidangalbraith1904 5 жыл бұрын
@@aisforanimate4703r/foundthemobileuser
@Max_G4
@Max_G4 5 жыл бұрын
@@aisforanimate4703 r/itswooooshwith4os
@bando81
@bando81 4 жыл бұрын
i had an issue and i figured it out without Brackey i am truly evolving
@ilovewizard
@ilovewizard 3 жыл бұрын
great job man improvement doesnt come immediatly
@XtrminatR7
@XtrminatR7 Жыл бұрын
I think the reason Brackeys is more popular than other unity youtubers is that not only he makes great tutorials, he also explains the code so even a 5 year old could understand. Great job brackeys!
@zojirushi1
@zojirushi1 5 жыл бұрын
Brackeys ur becoming John Wick :O
@mason3872
@mason3872 5 жыл бұрын
Keanu god bless that mans soul...
@echelon5162
@echelon5162 5 жыл бұрын
Didn't like because I didn't want to ruin the 69
@eoeo_bin5874
@eoeo_bin5874 5 жыл бұрын
Jonathan.....
@ipostanythingandeverything8554
@ipostanythingandeverything8554 5 жыл бұрын
Swedish John Wick
@menrodbaquiran2467
@menrodbaquiran2467 5 жыл бұрын
Nope he is becoming the Jesus Christ of game dev 🤣
@Roundbeargames
@Roundbeargames 5 жыл бұрын
i grew up playing gta2 and hotline miami was one of those games that made me wanna be a game developer. top down shooters will always have a special place in my heart :)
@Jalechah
@Jalechah 5 жыл бұрын
i don't make 2D games, but i still end up learning tips and tricks from these videos that i can use. Thanks for another awesome, well explained video :)
@Nat1Games
@Nat1Games Жыл бұрын
this is the first thing i've been able to successfully get working on unity- thank you so much man.
@GoronTico
@GoronTico 5 жыл бұрын
I miss a couple of brackeys episodes and suddenly he is jesus LOL
@BoundfoxStudios
@BoundfoxStudios 5 жыл бұрын
too :D
@aboowjaooo
@aboowjaooo 5 жыл бұрын
lmao
@deglor1660
@deglor1660 5 жыл бұрын
unity jesus
@pickle2835
@pickle2835 5 жыл бұрын
Y E S !
@ZiRR0
@ZiRR0 5 жыл бұрын
HAHAHHAHA
@mehmedcavas3069
@mehmedcavas3069 5 жыл бұрын
Brackeys please make a video about clean code or solid solid principles :)
@pizzatrain9600
@pizzatrain9600 5 жыл бұрын
Would be nice
@LeMustache
@LeMustache 5 жыл бұрын
Most of them don't apply to unity, because the workflow is so different from a regular .NET app
@DAVIN-qu5yq
@DAVIN-qu5yq 5 жыл бұрын
Would be awesome
@rafaeldefreitas5689
@rafaeldefreitas5689 5 жыл бұрын
@@LeMustache Yes, the workflow is very different, but Clean Code is always welcome and SOLID can be applied. If you search a bit on youtube there are some videos on it. (Even tho I'm not a fan of OOP xp)
@LeMustache
@LeMustache 5 жыл бұрын
@@rafaeldefreitas5689 True, but I still don't think unity projects would benefit much from SOLID principles. Doing a video how to create and manage a big project without making it an unreadable, chaotic mess would be much nicer, since they aren't many good tutorials on this out there. Quill18creates has some good videos on this, but they are usually part of some long series where he basically creates a game, not real tutorials.
@Pegaryx
@Pegaryx 4 жыл бұрын
You magnificent beast, thank you for sharing this wizardry! This sparked my interest in Unity one again. Nicely done, well put, amazing job!
@joshuamekeel4975
@joshuamekeel4975 5 жыл бұрын
I've already done this a couple times but I still like watching your videos to see how others would do it!
@unscriptedlogicgames
@unscriptedlogicgames 4 жыл бұрын
Nobody: Brackeys: "Now if we save this and head back into unity..." Me: I'm a bout to witness some magic aren't I?
@croutqn4550
@croutqn4550 4 жыл бұрын
Haha can't relate more
@gregoryfenn1462
@gregoryfenn1462 5 жыл бұрын
I like this new hairstyle man :)
@nostalgia5031
@nostalgia5031 5 жыл бұрын
Me too!
@mamuch7665
@mamuch7665 5 жыл бұрын
I've been waiting for this tutorial. Thanks Brackeys, please keep it up.
@freezeboy13
@freezeboy13 4 жыл бұрын
Well about that last part...
@DiogoSilva-js3rn
@DiogoSilva-js3rn 4 жыл бұрын
Hi! I'm Brazilian, and, to love your channel, many things are not found for my language unfortunately, but you do it so calmly, and step by step you can understand it without knowing anything about English, just knowing a little of a language ,the creation.
@echelon5162
@echelon5162 5 жыл бұрын
*_Thank you for tuning in at Brackeys_*
@animationspace8550
@animationspace8550 4 жыл бұрын
*cue happy guitar sounds*
@johnnyxp64
@johnnyxp64 5 жыл бұрын
one of the best videos of yours! simple and complete not split in many parts!
@forvicommits
@forvicommits 4 жыл бұрын
@9:23 you have to do -90f because for Unity the std 0 degree is to the right. and you later addForce to the up vector. if you use rb.AddForce(firePoint.right) you dont have to do -90. But beware you have to rotate the sprite in the prefab also to point to the right.
@NO-pf2gp
@NO-pf2gp 4 жыл бұрын
This is the only tutorial I could find that actually does what I need it to do. Thanks!
@sillyfella2009
@sillyfella2009 4 жыл бұрын
Brackeys: **exists* Jason Weimann: *Allow Me To Introduce Myself*
@schnitzelhai1730
@schnitzelhai1730 4 жыл бұрын
I don´t know what I would do without your videos. I´m sure, I couldn´t complete at least one game. Thanks.
@michaelwarwavesyn9391
@michaelwarwavesyn9391 5 жыл бұрын
After bombing the recent GameJam I just signed up for Jason's course. I'm a little skeptical but if Brackeys recommends him then I'm all for it. Wish me luck everyone!
@swagedwin
@swagedwin 5 жыл бұрын
I wish you luck.
@Pootisbird69
@Pootisbird69 Жыл бұрын
Was it good?
@ztin4532
@ztin4532 3 жыл бұрын
for anyone who came here just for the shooting tutor 10:01 no need to thank me we all needed it :D
@PitaPaka91
@PitaPaka91 5 жыл бұрын
Well, I guess I don't mind my Unity teacher being the Lord himself. All hail Brackeys!
@StaredownGames
@StaredownGames 5 жыл бұрын
Well...this tutorial is WAY better than the one I was working on, with the same end result. I went the raycasting route. I am gonna attempt my dream game (GTA+NFS+CAR MECHANIC SIM) in top down 2D. You are the best, Brackeys! Awesome teaching skills!
@TrashEntertainment_hehe
@TrashEntertainment_hehe 2 жыл бұрын
You can’t attempt your dream game with this crappy guy he dosent even teach you anything he just says hey retard do this
@StaredownGames
@StaredownGames 2 жыл бұрын
@@TrashEntertainment_hehe That's okay! Everybody has their own style. It makes the world interesting! I've learned so much since this video from so many talented people! I just discovered Greg Dev Stuff. Thick Russian accent but amazing channel, check it out!
@7fuss6
@7fuss6 Жыл бұрын
have u start ur dream game ?
@redwaffle6717
@redwaffle6717 Жыл бұрын
How is your dream game going??
@StaredownGames
@StaredownGames Жыл бұрын
@@redwaffle6717 I'm afraid I have lost most of my vision now and only JUST got a computer going again after quite some time. If I can still find my way around a game engine I just might start back up again lol Thanks for asking!
@lubaka8269
@lubaka8269 5 жыл бұрын
Can't not say that i feel like Brackeys is trolling us, uploading this right after the jam! Great video though!
@davidtimms4670
@davidtimms4670 4 жыл бұрын
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public float moveSpeed = 5f; public Rigidbody2D rb; public Camera cam; Vector2 movement; Vector2 mousePos; // Update is called once per frame void Update() { movement.x = Input.GetAxisRaw("Horizontal"); movement.y = Input.GetAxisRaw("Vertical"); mousePos = cam.ScreenToWorldPoint(Input.mousePosition); } private void FixedUpdate() { rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime); Vector2 lookDir = mousePos - rb.position; float angle = Mathf.Atan2(lookDir.y ,lookDir.x) * Mathf.Rad2Deg - 90f; rb.rotation = angle; } } this is for 2d movement and for me so i can come back in the future
@GSBN22
@GSBN22 4 жыл бұрын
Lemme just control c and control v
@esertekin9727
@esertekin9727 4 жыл бұрын
you didn't deleted the "// Update is called once per frame" and made everyone triggered.
@algs5483
@algs5483 4 жыл бұрын
@@esertekin9727 @least there is no // Start is called...
@LarryDoesGam1ng
@LarryDoesGam1ng 4 жыл бұрын
@@esertekin9727 lol I would edit the comment just it is on my other account
@Gamer-King69
@Gamer-King69 4 жыл бұрын
Thanks ur a legend , my script didn't work for some reason i just copy and pastet this and it works :)
@orionsswords
@orionsswords 4 жыл бұрын
You can solve the "need to offset by -90°" problem by having your sprites start pointing to the right rather than up. 0° in screen space points to the right rather than up/forwards like a compass.
@saalbyv6436
@saalbyv6436 2 жыл бұрын
its because you put -90 not - 90
@rodrigoaltamiranda8949
@rodrigoaltamiranda8949 Жыл бұрын
@Concrete thx
@SamppaYT
@SamppaYT Жыл бұрын
@Concrete Mine are still flying 90 degrees in the wrong direction even though I rotated the firePoint :(
@TidaliCreative
@TidaliCreative 2 жыл бұрын
After watching like 10 tutorials, this one actually worked for me. I'm so happy I could finally make my character rotate 😭😭😭😭
@animationspace8550
@animationspace8550 5 жыл бұрын
1:41 *Top ten heroes Thanos was to afraid to fight*
@beetal3850
@beetal3850 4 жыл бұрын
lol
@desmondcayce
@desmondcayce 4 жыл бұрын
lol
@thelixator
@thelixator 3 жыл бұрын
lol
@minhtri7525
@minhtri7525 2 жыл бұрын
14:37 Really, really i spent a lot of time on this shooting feature, thank you so much! 💙💙💙
@mikaxms
@mikaxms 5 жыл бұрын
8:00 If you don't want to mess with angles and rotations, just do transform.up = direction.normalized
@Rorius
@Rorius 5 жыл бұрын
I was wondering if someone was going to comment this I always use transform.up/right rather than the atan2 function just cause I feel like I can write my code in less lines (and it's been a while since I worked with trigonometry haha)
@alexnoah6154
@alexnoah6154 5 жыл бұрын
I dont know but i think Atan2 is butter cuz it will return one angle transform.up change all angles
@tombusckull
@tombusckull 4 жыл бұрын
where do i put this?
@dv5870
@dv5870 4 жыл бұрын
It is easier to write but will mess up player directions.
@SaberVS7
@SaberVS7 5 жыл бұрын
Well, didn't think I'd end up inadvertently finding this by searching the *exact title* on Google a mere twenty minutes after it got posted.
@ayushsagar8074
@ayushsagar8074 4 жыл бұрын
This is so sad because he stopped making vids now
@artinmajidi1654
@artinmajidi1654 4 жыл бұрын
yeah he was one of thee best :(
@cmdrapollo9699
@cmdrapollo9699 4 жыл бұрын
he was a good man
@animationspace8550
@animationspace8550 4 жыл бұрын
RIP brackeys. They will forever be in our hearts. ✊😞
@ayushsagar8074
@ayushsagar8074 4 жыл бұрын
@@animationspace8550 Thats cool and all but its not like he's dead or something. He has other things in life but true he will be in our hearts forever.
@Nowfen
@Nowfen 2 жыл бұрын
when i was making the shooting code when i had just started out in unity i didnt know anything about what he was saying but now after me getting 3 months of experience... i find it really clever he played around with like the variables and using the "= sign" to reference to the bullet and get its rigidbody2d and transfer it to the player rigidbody2d im bad at explaining but in my head its a really cool thing to use references like this
@TimbavatiLion
@TimbavatiLion 5 жыл бұрын
Next video is about Particle Effect Shooting? :D Create a Flamethrower-like particle effect at the end of the gun, give the particles a Collider... and set everything on fire!
@theindianyouwatch
@theindianyouwatch 3 жыл бұрын
*unity's particle system*
@ThoonderClips
@ThoonderClips 3 жыл бұрын
@@theindianyouwatch a great system for making particles
@-poison8075
@-poison8075 3 жыл бұрын
@@ThoonderClips *making particles*
@eleonoox
@eleonoox 2 жыл бұрын
I like your videos because you explain what's happening and that's very useful for me as a beginner
@deejay4264
@deejay4264 5 жыл бұрын
My boy Brackeys is slowly but surely becoming the John Wick of Game Devs. Look at that mane 😎 "People keep asking me if I've implemented a back button. I'm thinkin I'll implement a back button" 😂
@raviolipopcorn668
@raviolipopcorn668 5 жыл бұрын
I was just wondering how to do this yesterday! Now this is super convenient. Great work, as always.
@btarg1
@btarg1 5 жыл бұрын
Yet again, brackeys reads my mind.
@caliche2000
@caliche2000 5 жыл бұрын
I love this video because I was thinking of making a game using these exact mechanics. Thank you so much.
@seraphimsarecoool
@seraphimsarecoool 5 жыл бұрын
when i got back form school i will try recreating something like this good work! +like :)
@imviciously
@imviciously 4 жыл бұрын
@Yolo KFC Maybe he isn't a english native speaker? He misspelled one word and you are calling him a kid?? What if he is 19 y.o. lmfao
@imviciously
@imviciously 4 жыл бұрын
@Yolo KFC Go back to school, kid.
@Carnation1508
@Carnation1508 3 жыл бұрын
:)
@calebpaterson4165
@calebpaterson4165 5 жыл бұрын
Brackeys you are reading my mind. i have been drifting in and out of game dev but this time i want to stick with it and whenever i start again i think of a cool game type to make you just upload a video on it. for example before i thought it would be fun to make a 2d game and of course you just made a video about it and now the same with top down shooting
@gorkemvids4839
@gorkemvids4839 5 жыл бұрын
Instead of angle calculation, you can use transform.rotation = Quaternion.lookdirection(mausepos-rb.pos, vector3.forward);
@Alex-oy4qn
@Alex-oy4qn 4 жыл бұрын
where i must put it in using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public float moveSpeed= 5f; public Rigidbody rb; public Camera cam; Vector3 movement; Vector3 mousePos; // Update is called once per frame void Update() { movement.x = Input.GetAxisRaw("Horizontal"); movement.y = Input.GetAxisRaw("Vertical"); mousePos = cam.ScreenToWorldPoint(Input.mousePosition); } private void FixedUpdate() { rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime); Vector3 lookDir = mousePos - rb.position; float angle = Mathf.Atan2(lookDir.y, lookDir.x) * Mathf.Rad2Deg - 90f; rb.rotation = angle; } }
@gorkemvids4839
@gorkemvids4839 4 жыл бұрын
​@@Alex-oy4qn private void FixedUpdate() { rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime); rb.rotation = Quaternion.lookdirection(mausepos-rb.pos, vector3.forward); }
@Alex-oy4qn
@Alex-oy4qn 4 жыл бұрын
@@gorkemvids4839 thx
@menrodbaquiran2467
@menrodbaquiran2467 5 жыл бұрын
He has fully embraced the role as lord and savior of gamedev community.
@xXSuperLeagueSpieler_HDLPXx
@xXSuperLeagueSpieler_HDLPXx 5 жыл бұрын
*Its actualy fairly easy * (continues to speak in alien language)
@chaosmastermind
@chaosmastermind 4 жыл бұрын
Reminds me of a fourth grade exercise that my teacher made us do. Try to explain to an alien how to make a peanut butter and jelly sandwich. She did literally everything we said. Literally. When someone said to put the peanut butter on the bread, she put the whole jar on top of the loaf.
@sir_pheonez4048
@sir_pheonez4048 3 жыл бұрын
@@chaosmastermind That must have been fun
@chaosmastermind
@chaosmastermind 3 жыл бұрын
@@sir_pheonez4048 It was extremely frustrating for the entire class to find the right words without her making a monkey paw mockery of it.
@sir_pheonez4048
@sir_pheonez4048 3 жыл бұрын
@@chaosmastermind :| oh...
@theindianyouwatch
@theindianyouwatch 3 жыл бұрын
Relay table
@chris_themartin
@chris_themartin 5 жыл бұрын
You're breathtaking, Brackeys!
@Marcii6
@Marcii6 4 жыл бұрын
george floyd? can u look in the future
@Fremdscham-uu3xv
@Fremdscham-uu3xv 3 жыл бұрын
9:37 "rb.rotation = angle" angle is red marked "CS0029"
@mittensandsnowdrop
@mittensandsnowdrop 2 жыл бұрын
Try rb.SetRotation(angle) instead.
@novarl4115
@novarl4115 2 жыл бұрын
Bro i love you so much that I actually be watching the ad's
@el2746
@el2746 5 жыл бұрын
Doesnt know why but that shooting looks really satisfying :O
@CirbyWeh
@CirbyWeh 5 жыл бұрын
Once again an amazing and useful video! Would love to see a video from you about the 2D Shadergraph that got introduced in 2019.2f Keep up the good work
@uareducked5195
@uareducked5195 3 жыл бұрын
I didn't know john wick is making unity tutorials.
@jakashgaming4032
@jakashgaming4032 6 ай бұрын
🤣🤣🤣🤣🤣🤣🤣🤣
@-VexyRS
@-VexyRS 2 жыл бұрын
This covered EXACTLY what I was struggling with!
@averyguitartech
@averyguitartech 5 жыл бұрын
Lol i was just learning how to make a topdown game and could figure out the shooting lol.... Perfect timing! Can you please make a 1 month jam?
@roleks560
@roleks560 5 жыл бұрын
1 month is a lot
@roleks560
@roleks560 5 жыл бұрын
Cus you can make a game in 1 day Wich can be a cube with physics and an enemy spawnere and your done lol
@MaoDev
@MaoDev 5 жыл бұрын
1 month is too much. Even 1 week was pretty long so no, 1 month game jam is out of the question imo.
@zokaper801
@zokaper801 5 жыл бұрын
Roleks And Mao dude he legit JUST SAID he is having trouble with something pretty basic. Ok well, not THAT basic but it's not exactly computer science either, meaning that Sir is probably a beginner. And usually, they need more time. I honestly think a 1-month jam would be good for beginners.
@MaoDev
@MaoDev 5 жыл бұрын
@@zokaper801 nope, 1 month jam is too much even for a beginner. A week is alright, but 1 month is too much.
@ballkicker2391
@ballkicker2391 4 жыл бұрын
your videos are just gold
@prometheus625
@prometheus625 5 жыл бұрын
Would be interested to see 2D melee combat covered. I tried doing it once and it was a bit of a mess... nice vid and hair :D
@monstereugene
@monstereugene 2 жыл бұрын
brackeys did do that actually kzbin.info/www/bejne/qYHMh61noJKZe9U
@nikhilkumar1885
@nikhilkumar1885 4 жыл бұрын
As always, tutorial was great Thank you 😊
@devnyorm944
@devnyorm944 5 жыл бұрын
NOTE : the character pack is no longer available, for me atleast
@apolion6197
@apolion6197 5 жыл бұрын
You can buy it for 5$ but you probably searched for free assets, thats why it did not show up.
@lozD83
@lozD83 4 жыл бұрын
@@apolion6197 I think they caught on to the high volume of free downloads coming from here and decided they'd adjust things according to supply & demand :)
@felipethepro467
@felipethepro467 4 жыл бұрын
@@lozD83 yeah pretty smart move, but i still wont buy anyways.
@wizwizard7382
@wizwizard7382 11 ай бұрын
if when you fire the bullet doesnt show and it just does the hit effect immediately, make sure the player hitbox doesnt go in front of the fire point.
@darkshot3700
@darkshot3700 8 ай бұрын
Are the armored tanks assets free for you?
@jokerblade6719
@jokerblade6719 5 жыл бұрын
out of curiosity is there a way to get a weapon to float around the player as a pivot point that rotates around the player based on the mouses position ?
@juanpablogutierrez1288
@juanpablogutierrez1288 4 жыл бұрын
We miss you
@sajuthomas09
@sajuthomas09 4 жыл бұрын
Can u say which version is this
@jhosuarodriguez8243
@jhosuarodriguez8243 5 жыл бұрын
My character is moving back when ever i shot and my bullets come out at a -90 degree angle and i dont know how to fix it
@jhosuarodriguez8243
@jhosuarodriguez8243 5 жыл бұрын
I fixed it all I had to do was change my gun point rotation to -90.
@manuelfont4494
@manuelfont4494 5 жыл бұрын
@@jhosuarodriguez8243 Thanks!!
@tezra2443
@tezra2443 5 жыл бұрын
My bullet is not showing
@rominator
@rominator 4 жыл бұрын
Relja Margetic pls can you send me that code I don’t know where to change the gun point rotation
@tbsrgames
@tbsrgames 5 жыл бұрын
Harikasın!! Sen en takıldığım işi çözmeme yardım ettin ya; Allah'ta senin yolunu açık etsin :))
@burnax9817
@burnax9817 4 жыл бұрын
Amin
@tbsrgames
@tbsrgames 4 жыл бұрын
@@aaaaaaaaaaaaaaaaaaaaaaaaa275 ben zaten kendi yolunu aç demediğim için; hakkın rahmetine ulaşacağın gün "Allah taksiratını affetsin" diye arkandan rahmet duasında bulunacakların dualarını ilettiği makam tüm dilleri biliyo problem yok hatta pek bi anlamı var 😉
@vincentjenei
@vincentjenei 5 жыл бұрын
Bullet Code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class bullet : MonoBehaviour { public GameObject hitEffect; private float effectDuration; void Start() { effectDuration = hitEffect.GetComponent().main.startLifetime.constant; } void OnCollisionEnter2D(Collision2D collision) { GameObject effect = Instantiate(hitEffect, transform.position, Quaternion.identity); Destroy(effect, effectDuration); Destroy(gameObject); } }
@lordtomlluckrahthegreat9014
@lordtomlluckrahthegreat9014 2 жыл бұрын
Don´t you mean "Code Bullet"?
@coffinbonq
@coffinbonq Жыл бұрын
my bullets do not destroy themselves on collision but the code is exactly the same as here, could you suggest an ything?
@pythondoesstuff5722
@pythondoesstuff5722 2 жыл бұрын
Even with brackeys gone from KZbin, the first thing that pops in my head whenever I encounter a problem is his name, he is basically the Jesus Christ of gamedev
@mironco9595
@mironco9595 5 жыл бұрын
Brackeys: Only one that participates in own game jam. Also Brackeys: Makes video on topdown shooting. Me: Where’s the game jam video! : )
@jochenpanjaer980
@jochenpanjaer980 5 жыл бұрын
I think many of the creators of the collaboration jam did join in as well. BTP did!
@iDigvijaysinhG
@iDigvijaysinhG 5 жыл бұрын
Asbjörn, you are breath-taking
@harshshah8772
@harshshah8772 4 жыл бұрын
I need help, every time I try to shoot the bullet would only shoot up no matter where I would aim it
@Fegit69
@Fegit69 5 жыл бұрын
I really dig the new style of yours with that hair!
@mikethegamedev
@mikethegamedev 4 жыл бұрын
Don't mind me,i just doing a stamps for myself. 2:56 - 4:57 player movement 5:21 -10:23 - 14:46 Player aiming
@mikethegamedev
@mikethegamedev 4 жыл бұрын
@Yolo KFC i said i just doing a stamp FOR MY SELF!!!!!!!!!!!!!!!!!!!!!!
@mikethegamedev
@mikethegamedev 4 жыл бұрын
Lmao
@mikaxms
@mikaxms 5 жыл бұрын
Jason is personally bankrolling Brackeys!
@aimeeharper5130
@aimeeharper5130 5 жыл бұрын
Hey, could you tell me if this would work with 3D ?
@ArtisticBeef5661
@ArtisticBeef5661 4 жыл бұрын
It won't
@aurelienlerochbermuda6600
@aurelienlerochbermuda6600 5 жыл бұрын
Thx for the video, Jason(unity college) is realy the man you need for advance to the next step in Unity after watching Brackeys.
@tylerstyle307
@tylerstyle307 5 жыл бұрын
Hey Brakeys, can you do a tutorial on character selection? It would be really nice!
@umarhyatt6104
@umarhyatt6104 4 жыл бұрын
brackey you are my best teacher
@2dinunity10
@2dinunity10 5 жыл бұрын
How does this work? I have to do this in the update function to get this to work: var rawmouse = Input.mousePosition; rawmouse.z = 10; mousePos = cam.ScreenToWorldPoint(rawmouse);
@MarcoBeckmann
@MarcoBeckmann 5 жыл бұрын
You should change the projection of the camera to orthographic (or choose make your project as 2D)
@connorwhyte3891
@connorwhyte3891 5 жыл бұрын
Got a Cyberpunk ad, started thinking of Keanu Reeves and then you pop up on screen with your new haircut. Needless to say, I was startled.
@simongarrettmusic
@simongarrettmusic 4 жыл бұрын
Rad video, dug that a lot
@ploonky12345
@ploonky12345 4 жыл бұрын
I have a problem, whenever I add the bullet script it only plays the animation but the actual bullet never comes out
@casachezdoom2588
@casachezdoom2588 3 жыл бұрын
Yeah I have the same issue, actually I can see the bullet for a brief moment and if I shoot quickly while moving the mouse I see at bullet flying through. I think the bullet is colliding with itself or something...
@casachezdoom2588
@casachezdoom2588 3 жыл бұрын
Hey I doubt you're still looking for the solution to this after 4 months, but it might help out someone else. If your bullet explodes as soon as it comes out of your gun, move your FirePoint slightly away from the player so the bullet doesn't touch the Player when it is instantiated, it worked for me.
@dooperGaming
@dooperGaming 3 жыл бұрын
@@casachezdoom2588 Dude thank you. I honestly feel like an idiot for not thinking of that
@casachezdoom2588
@casachezdoom2588 3 жыл бұрын
@@dooperGaming Glad I could be of some help!
@SteveGresh
@SteveGresh 5 жыл бұрын
thank you so much for ALL of your videos they are a very big help!!!
@AdamCodes2
@AdamCodes2 5 ай бұрын
*Source Code* using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public float moveSpeed = 5f; public Rigidbody2D rb; public Camera cam; Vector2 movement; Vector2 mousePos; // Update is called once per frame void Update() { movement.x = Input.GetAxisRaw("Horizontal"); movement.y = Input.GetAxisRaw("Vertical"); mousePos = cam.ScreenToWorldPoint(Input.mousePosition); } private void FixedUpdate() { rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime); Vector2 lookDir = mousePos - rb.position; float angle = Mathf.Atan2(lookDir.y ,lookDir.x) * Mathf.Rad2Deg - 90f; rb.rotation = angle; } }
@chaitanyareddy3348
@chaitanyareddy3348 5 жыл бұрын
You are the best, Brackeys you helped me so much thank you, you are just the best.
@darkfateinc7333
@darkfateinc7333 5 жыл бұрын
My "Player" does not follow to Cursor. But, he follow to camera, which stand still. Help! (p.s. sorry for my english)
@2dinunity10
@2dinunity10 5 жыл бұрын
Try this in the update function (replace mousePos = cam.ScreenToWorldPoint(Input.mousePosition) var rawmouse = Input.mousePosition; rawmouse.z = 10; mousePos = cam.ScreenToWorldPoint(rawmouse);
@josephpizzati8325
@josephpizzati8325 4 жыл бұрын
@@2dinunity10 Thank you!!!!!
@deglor1660
@deglor1660 5 жыл бұрын
this remember me a scene some moths ago: you are breathtaking
@TFDANTIFURRY
@TFDANTIFURRY 3 жыл бұрын
the armored soldiers pack thing isn't free anymore but thats cool i guess
@TempKarrt
@TempKarrt 5 жыл бұрын
Yessss I was loooking for this for a long time
@netfusionuk
@netfusionuk 5 жыл бұрын
Great Tutorials as always bud, my explosion animation is playing twice before being destroyed however, not sure what i did wrong there.
@samuelcrouse9276
@samuelcrouse9276 5 жыл бұрын
Steven Moore You might check to see if you have loop time on. If so turn it off then it will only play once. Idk if that’s your problem but good luck!
@Definitely_a_Fox
@Definitely_a_Fox 5 жыл бұрын
#1. It'd be really nice to see how to do this with controller input! #2. Loving the hair! Keep it up!
@Robber7
@Robber7 5 жыл бұрын
its exactly the same
@kuylardev
@kuylardev 5 жыл бұрын
Brackeys hair is now Keanu Reeves
@asaltspyre6087
@asaltspyre6087 5 жыл бұрын
Hi! Thank you for the video. What is a "muscle flare"? ( 18:54 ) Google doesn't give much useful information on what that could be.
@Deeox2
@Deeox2 5 жыл бұрын
He actually said "muzzle flare". Not too sure what a muscle flare is either, haha.
@asaltspyre6087
@asaltspyre6087 5 жыл бұрын
@@Deeox2 Ah, that makes a lot more sense. I thought I misheard so I turned on the Closed Captions and they said "Muscle Flare" too. Thanks for clearing that up!
@jankkhvej434
@jankkhvej434 4 жыл бұрын
//I hope I saved you some time using System.Collections; using System.Collections.Generic; using UnityEngine; public class shooting : MonoBehaviour { public Transform firePoint; public GameObject bulletPrefab; public float bulletForce = 20f; // Update is called once per frame void Update() { if(Input.GetButtonDown("Fire1")) { Shoot(); } } void Shoot() { GameObject bullet = Instantiate(bulletPrefab, firePoint.position, firePoint.rotation); Rigidbody2D rb = bullet.GetComponent(); rb.AddForce(firePoint.up * bulletForce, ForceMode2D.Impulse); } }
@matthew12438
@matthew12438 2 жыл бұрын
Absolute legend, my script didn't work but yours did, I must of spelt something wrong or something, thanks
@_abrahamxxv_962
@_abrahamxxv_962 2 жыл бұрын
my hero
@heartloss3751
@heartloss3751 2 жыл бұрын
i got 9 errors from this :/
@heartloss3751
@heartloss3751 2 жыл бұрын
I fixed it was a simple mistake from me :)
@tsivilsඞ
@tsivilsඞ 2 жыл бұрын
@@heartloss3751 i am having issues too what did u do
@Severely_Distracted
@Severely_Distracted Жыл бұрын
This video was extremely helpful, thank you!
@skelonz2612
@skelonz2612 4 жыл бұрын
after i finish the shooting script. when i play it just start automaticallly firing up
@oldthumper1013
@oldthumper1013 4 жыл бұрын
ツRilly make shore that there is no semi coolant after if(Input.GetButtonDown(“fire1”)) Hope this helps
@oguhnosam
@oguhnosam 4 жыл бұрын
@@oldthumper1013 this same thing happened to me thanks for helping!
@oldthumper1013
@oldthumper1013 4 жыл бұрын
oguhnosam I have already done this so if you need anything else just say
@christopherjr7189
@christopherjr7189 5 жыл бұрын
Can you please make *3d* game tutorials again?
@aminthemar
@aminthemar 5 жыл бұрын
Tarzan is teaching us game development. Awesome!
MELEE COMBAT in Unity
21:07
Brackeys
Рет қаралды 1,6 МЛН
7 DEVS Make a GAME without COMMUNICATING! (centipede edition)
17:16
Blackthornprod
Рет қаралды 1,2 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
How To Get The CLEANEST VS Code Setup!
8:20
b001
Рет қаралды 4,8 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,4 МЛН
Brackeys Game Jam 2020.2 - BEST GAMES!
11:31
Brackeys
Рет қаралды 551 М.
TOP DOWN MOVEMENT in Unity!
22:30
Brackeys
Рет қаралды 1,2 МЛН
The Most Impressive Scratch Projects
11:00
DenshiVideo
Рет қаралды 5 МЛН
I Paid Devs on Fiverr to Make an Open World Game
8:33
Minimunch
Рет қаралды 507 М.
Making a TOP-DOWN SHOOTER in 10 minutes VS 1 hour VS 1 day!
8:34
Blackthornprod
Рет қаралды 148 М.
TOP DOWN Movement - Unity Tutorial
16:17
Sasquatch B Studios
Рет қаралды 20 М.
HOW TO GAME JAM!
9:01
Brackeys
Рет қаралды 291 М.
How I Made a 3D Platformer in 2D Game Engine
21:23
ggenije
Рет қаралды 599 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН