Unity 2D Aim and Shoot at mouse position Tutorial

  Рет қаралды 86,147

MoreBBlakeyyy

MoreBBlakeyyy

Күн бұрын

Пікірлер: 163
@gab0thebab068
@gab0thebab068 9 ай бұрын
Thank you for providing an explanation for each line instead of just telling us what to write!
@jacksonkalvin1205
@jacksonkalvin1205 2 жыл бұрын
Hey dude, I've been doing a bunch of your tutorials recently, and I just wanted to thank you. I was stuck for quite a while on my 2d platformer, and now I'm making a whole bunch of progress thanks to these videos!
@duckman1824
@duckman1824 2 жыл бұрын
I searched up tutorials for a solution, because my Fireball wasn't moving until I noticed that I haven't set it to any speed value but then I saw how you made it. And Thank your for the tutorial so my fireball also turns to the mouse position!
@Jaskier13
@Jaskier13 9 ай бұрын
Hey guys, for those of whom this does not seem to work, also ensure that your camera is set to orthographic and not perspective. I faced the same problem and struggled so you don't have to. So best of luck with your games, travellers!
@Henry-zq2td
@Henry-zq2td 8 ай бұрын
Bro.. you don't know how much I love you right now!
@CardboardBones
@CardboardBones 7 ай бұрын
I appreciate it, thank you!
@Pixelnando
@Pixelnando 6 ай бұрын
thank you so much
@petrcermak1594
@petrcermak1594 4 ай бұрын
Truly a lifesaver even after two years
@acez28
@acez28 2 жыл бұрын
Yes!!! This is what I've been looking for Thanks a bunch man
@O5rrrk
@O5rrrk 4 ай бұрын
Jesus man. I just found your video. It's amazing how great it works :D Thanks for that man! I definitely come here more often xd
@dwjaguar3665
@dwjaguar3665 2 жыл бұрын
Man, you've saved me, thank you a LOT!! big fannn
@jjopilis6634
@jjopilis6634 4 ай бұрын
Thank you so much for this tutorial it will be extremely helpful for developing the game I'm in the midst of working on
@HylianLegend
@HylianLegend 2 жыл бұрын
If you place your cursor behind the weapon and near/on the player the projectile doesn't shoot correctly. Do you know how to fix this possibly? Also, while moving (say right) and shooting the opposite direction (left) the bullet is somehow overtaken by the player, and doesn't properly fire.
@maxn9022
@maxn9022 Жыл бұрын
same problem(
@candyandcarmel
@candyandcarmel Жыл бұрын
hey! if you dont really care about having the gun looking sprite visible, then you can just change the x in bulletTransform to 0
@HylianLegend
@HylianLegend Жыл бұрын
@@candyandcarmel thanks!
@RubensASMR
@RubensASMR Жыл бұрын
Thanks!!! I managed to convert it to visual code for my game I'm making. +1 like :)
@mdarix4236
@mdarix4236 2 жыл бұрын
Thank you, you helped me for my school project :)
@RandomMan10
@RandomMan10 Жыл бұрын
yo are u doing something called a personal project?
@mdarix4236
@mdarix4236 Жыл бұрын
@@RandomMan10 it was a test for school
@NathanSimmonds
@NathanSimmonds Жыл бұрын
Many thanks! This was clear and concise.
@deadadam666
@deadadam666 Жыл бұрын
exactly the info i needed - thanks
@naslb1rsey199
@naslb1rsey199 2 жыл бұрын
this video so clear and Understandable I hope it continues :D:D:D
@PropaneMuncher5000
@PropaneMuncher5000 2 жыл бұрын
Im getting an error on this line of code: mainCam = GameObject.FindGameObjectsWithTag("MainCamera").GetComponent(); the error says"'GameObject[]' does not contain a definition for 'GetComponent' and no accessible extension method 'GetComponent' accepting a first argument of type 'GameObject[]' could be found (are you missing a using directive or an assembly reference?)" could you help me out?
@Spider-Man_12345
@Spider-Man_12345 2 жыл бұрын
I'm having the same problem, did you ever figure it out?
@Spider-Man_12345
@Spider-Man_12345 2 жыл бұрын
He addresses this problem later in the video at 10:00, you have to make sure that you don't have an "s" in "FindGameObjectWithTag".
@jpr7857
@jpr7857 2 жыл бұрын
@@Spider-Man_12345 Thnks !!!
@Eaaaaaattmyasss
@Eaaaaaattmyasss 2 жыл бұрын
you are a legend , i love you
@kubix_to_miszcz9975
@kubix_to_miszcz9975 Жыл бұрын
Can you halp me? I wrote scripts correct but it doesn't work. Do you have any ideas why? Even weapon doesn't rotate.
@robelso5646
@robelso5646 2 жыл бұрын
I had a problem with my gun point rotating weirdly to my cursor, but after a lot of crying and praying I found that I made the simple mistake of confusing WorldToScreenPoint with ScreenToWorldPoint mousePos = mainCam.WorldToScreenPoint(Input.mousePosition); instead of mousePos = mainCam.ScreenToWorldPoint(Input.mousePosition); lol don't be stupid like me also great tutorial it was extremely helpful :)))
@morebblakeyyy
@morebblakeyyy 2 жыл бұрын
Good problem solving, thank you😁
@rvanallahverdiyev8575
@rvanallahverdiyev8575 2 жыл бұрын
Thanks Bro i love you
@astroidfrog644
@astroidfrog644 2 жыл бұрын
Mine said "ScreenToViewportPoint"
@potatolegacy
@potatolegacy Жыл бұрын
THX man
@swinub9317
@swinub9317 Жыл бұрын
Dude you just saved my life I was just about to have the moist life threatening, oxygen taking, the most intense panic attack/suicidal thoughts that even the voices in my head would go quiet. I am very thankful to you my sir, my savior you just opened my eyes wider to this cruel world in more extreme level than Jesus has ever done. Even words can't describe the amount of piece this man has gotten in my life. I can now happily die in piece.
@theboredbraxton6900
@theboredbraxton6900 4 ай бұрын
Thanks for the video Blakeyyy! However when I play the game, clicking right click only spawns in bullets, they don’t go forward at all, any ideas why? Once again thanks for the video!
@Pattarek
@Pattarek 15 күн бұрын
Great Tutorial.
@dogonumnum
@dogonumnum Жыл бұрын
thank you so much! This video really helped!
@ivannugiban5692
@ivannugiban5692 Жыл бұрын
Works nice! Thank you
@_arcadian._
@_arcadian._ 2 жыл бұрын
I have a bit of an issue with my rotation point. Since my character has a rotation flip because they walk, when the rotation goes to -1, my block starts to work opposite of the mouse. How can i make it so the rotation point references the Player rotation value? Thanks in advance
@ratonotota1508
@ratonotota1508 2 жыл бұрын
I had the same issue but Because I had to flip the gun, you just need to make the rotation angle negative when the player is flipped if(playerisflipped = true { transform.rotation = Quaternion.Euler(0, 0, -rotAngle); } else { transform.rotation = Quaternion.Euler(0, 0, rotAngle); }
@risinguppercot8414
@risinguppercot8414 Жыл бұрын
@@ratonotota1508 for me i had to change the x value to negative aswell as the rotation angle if (isFacingRight == false) { rotZ = Mathf.Atan2(rotation.y, -rotation.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.Euler(0, 0, -rotZ); }
@ililililil8385
@ililililil8385 10 ай бұрын
Good tutorial! I'm wondering what would be the best approach for making a spreadshot effect that builds off this shooting tutorial?
@Mr2019Gtag
@Mr2019Gtag 28 күн бұрын
Thank you this help A lot!
@Monkeyboy8008
@Monkeyboy8008 Жыл бұрын
Have you made another tutorial on how to make the bullets destroy the enemies? I've been looking around at other tutorials and none of them seem to be working
@candyandcarmel
@candyandcarmel Жыл бұрын
New to to game developement so sorry if this question is stupid: Why do we need a vector3 if we are in a 2d enviroment? Also what does the whole RotZ thing do in the script?
@gerardgarcia3088
@gerardgarcia3088 Жыл бұрын
a Vector2 only have x and y but a vector 3 have x,y and z
@DevBro857
@DevBro857 3 ай бұрын
if you dont get it to point in the right pos just add 90 degres
@aarononeale7727
@aarononeale7727 2 жыл бұрын
when having your cursor inbetween the player and the aiming block the projectile shoots down. do you know how to fix this possibly?
@reimy_el8702
@reimy_el8702 Жыл бұрын
Thank god man you saved me a lot
@miskasstories8035
@miskasstories8035 8 ай бұрын
Hey, i have stumbled apon a problem in which the rotating thingy gets flipped too when i flip my character, since its a child of its. Is there a way to fix this without rewriting my entire movent Code? And sorry for my broken english
@miskasstories8035
@miskasstories8035 8 ай бұрын
Im working on a 2d sidescorller btw so this is why i have to flip my player
@gabrielgauthier5611
@gabrielgauthier5611 8 ай бұрын
@@miskasstories8035 I resolved this issue with this : //Method for the mouse position private void Aim() { _mousePosition = mainCamera.ScreenToWorldPoint(Mouse.current.position.ReadValue()); Vector2 lookDirection = _mousePosition - _rigidbody.position; //Switch the rotZ and x look direction with the direction the player is facing if (!_isFacingRight) { _rotZ = Mathf.Atan2(lookDirection.y, -lookDirection.x) * Mathf.Rad2Deg; AimingPoint.transform.rotation = Quaternion.Euler(0, 0, -_rotZ); } else { _rotZ = Mathf.Atan2(lookDirection.y, lookDirection.x) * Mathf.Rad2Deg; AimingPoint.transform.rotation = Quaternion.Euler(0, 0, _rotZ); } } Hope it helps !
@jinium
@jinium 6 ай бұрын
​@@miskasstories8035 Are you flipping your player by multiplying the local scale by -1?
@Gacut
@Gacut 2 жыл бұрын
This tutorial is awesome! Do you plan to make something similiar in new InputSystem? I would like to add this behaviour to my game!
@bblakeyyy
@bblakeyyy 2 жыл бұрын
Thank you! Yeah at some point, I’m not a fan of the new input system and kind of want them to add some more documentation before I do some tutorials on it, just for some added support for people who watch the videos
@petross_128
@petross_128 11 ай бұрын
Hey man! Thanks for the video can you possibly create a tutorial how to detect collison with terrain and enemies?
@LuisRodriguez-wv4ol
@LuisRodriguez-wv4ol 8 ай бұрын
Hi dude, nice video but I have a question, how can I make the shoot at mouse position with a rectangle? I noticed the incorrect face of the rectangle (side face) points the mouse
@mrfhg9367
@mrfhg9367 2 жыл бұрын
is there any way to change the center of the rotating weapon? Mine is below the player
@Autta_GUM
@Autta_GUM Жыл бұрын
Can anyone help? My character goes from left to right. When he turns left, the RotatePoint turns with him. Because of that, when he turns left, everything reverses; and the bullets just go into my character.
@yf-maxi
@yf-maxi 10 ай бұрын
I added this code in the update function to flip the weapon when it goes above the player's head or below their feet so it's always facing the right direction. weaponRotation is just a sprite renderer I made the the top of the script. And the Weapon tag is on the game object with the weapon sprite. I hope this helps anyone trying to achieve the same thing. weaponRotation = GameObject.FindGameObjectWithTag("Weapon").GetComponent(); if (rotZ > 90 || rotZ < -90) { weaponRotation.flipY = true; } else { weaponRotation.flipY = false; }
@SuperCosmicSpaceMagnet
@SuperCosmicSpaceMagnet Жыл бұрын
So invaluable for my coursework - thanks so much! Why are you using Vector3 here though? I thought trying to use Vector3 in Unity2D caused the universe to implode.
@morebblakeyyy
@morebblakeyyy Жыл бұрын
Vector2 would’ve been fine here! Wouldn’t affect this situation using vector3, but for clarity it probably would’ve been better for vector2. Luckily the universe was fine in this case though
@SuperCosmicSpaceMagnet
@SuperCosmicSpaceMagnet Жыл бұрын
Ah okay. Thanks so much for the reply! Programming is an anathema to me, so having videos like this that clearly articulate everything step-by-step are immeasurably helpful. I was never taught C#, so I'm learning by doing. Without resources like yours I'd very literally be failing my degree right now because of this one module. @@morebblakeyyy
@morebblakeyyy
@morebblakeyyy Жыл бұрын
@SuperCosmicSpaceMagnet no prob! I’m still learning everyday, it’s a never ending journey. Best of luck with your module!
@t.b.g158
@t.b.g158 2 жыл бұрын
Thank you So much Mate!♥ But can you make a tutorial about Animation in Unity and how to deel with? And keep it simple like you always do♥
@morebblakeyyy
@morebblakeyyy 2 жыл бұрын
Of course👌🏻
@Tecrispi
@Tecrispi 4 ай бұрын
I'm trying to add bullet spread/inaccuracy for a bit of randomisation when you shoot (the direction the bullet goes) but I can't figure out how?
@duckman1824
@duckman1824 2 жыл бұрын
thank you so much
@SarahNarkum
@SarahNarkum Жыл бұрын
thank you very much for your tutorial! do you have one on/know how to make the bullets hurt/kill enemies?
@sirdoomtrain90
@sirdoomtrain90 Жыл бұрын
What if i want to hold a button to lock movement?
@alef_ah8331
@alef_ah8331 2 жыл бұрын
Nice and Quick
@HalfTangible
@HalfTangible Жыл бұрын
So, I have my fire point and such set up, and it fires bullets like I want, but the firepoint rotates in place when I want to rotate it around the player object. Is this a common issue?
@johnviti6245
@johnviti6245 6 ай бұрын
i have a propel the roation point isnt following my mouse instead its doing what ever my mouse does but on the other side if i am at the left of my player the rotation is on the right and if i move up my aim the rotation goes down any way to fix it?
@yuriiiiiiiiiiiiiiii
@yuriiiiiiiiiiiiiiii 2 жыл бұрын
The shooting works fine but I can't seem to figure out how to detect when the bullet hits an enemy, any help?
@krinspah8399
@krinspah8399 2 жыл бұрын
void OnTriggerEnter2D(Collider2D other) { if(other.CompareTag("Enemy")) { DestroyProjectile(); } } void DestroyProjectile() { Destroy(gameObject); } Add a trigger to your bullet on the inspector, and make sure your enemy matches the tag, in my case its enemy
@foxxtronix6556
@foxxtronix6556 Жыл бұрын
praying you still respond, this is the exact type of shooting i wanted but couldn’t find and finally found it. but im at 4:51 in the video and my gun doesn’t move with the mouse like it should
@gamesquad6743
@gamesquad6743 2 жыл бұрын
Can you do a boss fight tutorial?
@PlagenShiki
@PlagenShiki 2 жыл бұрын
This doesn't seem to work for me. I did things step-by-step, and while the little black sprite moves a bit, it is only a bit up and down. It won't follow the mouse completely.
@morebblakeyyy
@morebblakeyyy 2 жыл бұрын
this does still work! :)
@Gazntyno
@Gazntyno Жыл бұрын
This is a great tutorial! The only issue I'm having is that since my game is set up like a 2D platformer like Mario whenever I change direction ( from right to left ) the bullet transform flips and I end up shooting inward instead of out outward. I was wondering if anyone has found a fix for this as I am a beginner game developer with minimal programming experience. Any help would be greatly appreciated :)
@TheGamingRedCat
@TheGamingRedCat Жыл бұрын
I know this is late but maybe you could try running an if statement for this: if(playerFlipped == true) rotation *= -1; (basically just invert rotations to counteract player flip) probably inefficient but if you want to then you could do that (might not work actually im not sure lol)
@Quarkes
@Quarkes Жыл бұрын
Brackeys have made a tuturial where he talks about enemy pathfinding, where he needs to flip the graphics of the enemy maybe that could work.
@terza1458
@terza1458 5 ай бұрын
Thank you!
@trtl_playz
@trtl_playz 3 ай бұрын
how do i get the bullets to die on collision
@galberger3937
@galberger3937 9 ай бұрын
Hi. How can i make the player stay in his place and only the gun will move? how to make circles that spawn with different sizes?
@TheDreadGodlyPirates
@TheDreadGodlyPirates Жыл бұрын
Hey @MoreBBlakeyyy Loved the tutorial but i have an issue where you cans see the bullets and they are just stuck in one position so could you please help that would be great!
@foxxtronix6556
@foxxtronix6556 Жыл бұрын
is it the layers? also if you know anything about my issue help would be awesome, i’m at 4:51 rn and my gun or whatever should move and turn and point to the mouse but it isnt
@maslowpoet
@maslowpoet 2 жыл бұрын
Can you help me understand how to adjust the force value when the player is moving and firing at the same time? so that the bullet is not overtaken by player movement? thanks! great video (i've now subscribed ^^)
@justinbuchanan4714
@justinbuchanan4714 Жыл бұрын
you need to sow down the player speed or speed up the bullet's speed
@vintrex11
@vintrex11 14 күн бұрын
how do i assign it into two cameras?
@jjopilis6634
@jjopilis6634 4 ай бұрын
I’m having issues with the object the bullets fire from actually following my player? It just stays still even though it’s a child of the object, can anyone help me because I’d love to try to get more work done
@monkeypwners
@monkeypwners 4 ай бұрын
How do you delete the bullets after some time?
@ImethFernando
@ImethFernando Жыл бұрын
really great tutorials here thank a lot, but there is an error coming up with the current version on unity saying that the name rotation does not exist and im not sure how to fix this
@Zaddy.Griff.
@Zaddy.Griff. 11 ай бұрын
this is great and thank you but the problem im having is the point that the bullet shoots at isnt the player its this point on the screen even tho it is a child of the player oh and it doesnt move
@casimirberke
@casimirberke 10 ай бұрын
theres no delay on the bullets for me, despite the fact I have time between firing at 4?
@rezar722
@rezar722 Жыл бұрын
How do you andjust the speed of the bullet? Great video btw, helped me a lot:)
@koditom
@koditom Жыл бұрын
Increase the force.
@simonstechhacks
@simonstechhacks Жыл бұрын
Is the bullet supposed to make clones? I have no way to delete this so idk, I also made sure the bullet isnt in the Heirarchy and its in assets
@airconditioningac
@airconditioningac Жыл бұрын
I have a lot of bullets in my game so I had to make a new variable specifically for the clones and use the Delete function to prevent too much lag, so maybe this solution could work out for you // before the voids with your other variables private GameObject bulClone; public float bulletLife; // this is in seconds ... // under voidUpdate() if(Input.GetMouseButton(0) && canFire) { canFire = false; bulClone = Instantiate(bullet, bulletTransform.position, Quaternion.identity); Destroy(bulClone, bulletLife); // destroys the bullet clone after set number of seconds } I hope this helped with your problem :)
@NotKosyKebab
@NotKosyKebab 11 ай бұрын
thank you!@@airconditioningac
@davidpepice
@davidpepice 4 ай бұрын
simplemente genial master!!!!
@Yu-Yu-Jia
@Yu-Yu-Jia Жыл бұрын
Can you help me to understand how to change the bulletTransform with diffrent weapon , thx
@Great-Dao-of-Elegance
@Great-Dao-of-Elegance Жыл бұрын
I have an error which says that "object reference not set on an instance" the error is from the line "mainCam = GameObject.FindGameObjectWithTag " The bullet doesn’t move and stays from the position where I fire it from. Also I had to set the private Camera mainCam: to public in Shooting.cs for RotatePoint gameobject and drag the main camera towards the script. Because the gun won't move otherwise as it also shows the same error. I can’t do it with the Bullet script because when I drag the camera towards the bullet's script it says type mismatch.
@unamusedrowlett6303
@unamusedrowlett6303 9 ай бұрын
Hey dunno if your still stuck but if I had to guess, its because the Tag on Camera is called something else. His code tracks the Tag of the camera rather than the actual game object.
@Great-Dao-of-Elegance
@Great-Dao-of-Elegance 9 ай бұрын
@@unamusedrowlett6303 I solved it by just copying another different tutorial lol but thanks for the effort
@taterino2722
@taterino2722 2 жыл бұрын
I noticed that if the parent's sprite/shape isn't a square, the 'gun' stretches when rotating. How can this be fixed without having to make the player object evenly shaped?
@NotKosyKebab
@NotKosyKebab 11 ай бұрын
hi, did you ever find a solution to this?
@IM-ws5if
@IM-ws5if 2 жыл бұрын
Thanks brother, but I have a problem when the player moves to the left, move the bullet against the movement of mouse
@susheh866
@susheh866 Жыл бұрын
for some reason is says all compiler errors have to be fixed and i dont know why because i did everything you said to do
@imraptorr1066
@imraptorr1066 2 жыл бұрын
really usefull but i cant see the bullet, can you help me please?. The Bullet exists and i can see it on the Scene window just not on the Game window
@bblakeyyy
@bblakeyyy 2 жыл бұрын
What’s most likely happening is that it’s behind the camera on the Z axis. You need to add an offset in the script where you instantiate the bullet, so you combine a new vector 3 with where you currently spawn it So something like Vector 3 tempPos = new vector3(0,0,10) Instantiate(bullet, transform.position + temppos, quaternion.identity)
@imraptorr1066
@imraptorr1066 2 жыл бұрын
@@bblakeyyy yes it is some error of the z axis but this script didnt solve it. It makes perfect sense but it doesnt work
@Rat-du3jo
@Rat-du3jo Жыл бұрын
i am have a error that says Assets\Bullet.cs(9,13): error CS0246: The type or namespace name 'Rigidbody2d' could not be found (are you missing a using directive or an assembly reference?) anyone know how to fix it
@Butcherboy438
@Butcherboy438 2 ай бұрын
did you add a rigidbody to the bullet?
@cheeseburgersimulator
@cheeseburgersimulator 2 жыл бұрын
Mine says Object reference not set to an instance of an object
@darijus4094
@darijus4094 2 жыл бұрын
Hi could you help me with this: NUllReferenceException: Object reference not set to an instance of an object Shooting.Update ()
@cheeseburgersimulator
@cheeseburgersimulator 2 жыл бұрын
I got that to
@fenix_x_
@fenix_x_ Жыл бұрын
I have the same probelm
@juanchangoxd164
@juanchangoxd164 3 ай бұрын
do u have solution ?
@isimsizanimator1291
@isimsizanimator1291 Жыл бұрын
mine bullets go opposite of my character if i go left they go right
@DevBro857
@DevBro857 3 ай бұрын
transform.rotation = Quaternion.Euler(0,0, rotZ + 90);
@micflop3394
@micflop3394 Жыл бұрын
Someone please help it doesnt let me put the * symbol or theres an error but when i delete it theres more errors
@AbhilashKundu-fg3zg
@AbhilashKundu-fg3zg Жыл бұрын
In my gameobject the gun always stays +90deg in Z axis(if my cursor pos is perpendicular to the 0 deg in z axis)
@AbhilashKundu-fg3zg
@AbhilashKundu-fg3zg Жыл бұрын
Ahh i fixed it. I took out the black box(gun) along the Y sxis from within the parent player object. After i reset the position of the gun (black box) i moved it along the y axis, it worked. Is it because Y axis is the default to follow along the rotation through Z axis?
@skvirascz_
@skvirascz_ 2 жыл бұрын
I followed exactly the video, but after I turn it on and I want to shoot, the bullet doesn't appear. What should I do?
@morebblakeyyy
@morebblakeyyy 2 жыл бұрын
Check the hierarchy in game, it might be instantiating but it’s just behind the camera, or invisible, etc. If that’s not the case, there must be some code that’s not running correctly. Double check capital letters etc
@Xionic420
@Xionic420 2 жыл бұрын
my bullettransform is following the camera and the camera is in the middle of the world please someone help
@89-muhamadravyanto2
@89-muhamadravyanto2 2 жыл бұрын
at first it works fine with the mouse when not moving but when iam moving the gun rotating but iam not touching mouse at all
@matygamer6733
@matygamer6733 Жыл бұрын
I am trying to add this code to my player, and I get a bunch of errors. Can anyone help?
@z7l717
@z7l717 2 жыл бұрын
Thanks You Help Me
@morebblakeyyy
@morebblakeyyy 2 жыл бұрын
Make sure to subscribe!
@sheepsqad
@sheepsqad Жыл бұрын
can you make an shotgun with code or not?
@yuvalgabay1023
@yuvalgabay1023 Жыл бұрын
i really strugling here. im new into game making and i making a platfromer whit some shooting. trying to put a gun on my guy. want it to rotate around him 360 degrees, 3 problems arise 1: i cant get the gun to rotate around my player whit out the gun spining all around, its that or the gun rotate around its self(like a wheel). 2: phisycs for some reasoning affects my gun even if doesnt have a rb or the rb is on knimatic. 1: turing is way to fast and if my mouse is on the player he becoms a hlicopter. i have no idea what to do tried rotate around ,rotate axis and evert qaun what i neeed to do
@UrrutiaTitular
@UrrutiaTitular Жыл бұрын
The same thing happens to me, have you solved it yet?
@dospiir8045
@dospiir8045 Жыл бұрын
for the turning too fast problem, you can add a public float sensitivity, and then multiply the rotZ * sensitivity in the transform.rotation
@krus4
@krus4 Жыл бұрын
If someone can help than thank you because every time I shoot the Canfire gets disabled can anyone help
@drewster237
@drewster237 2 жыл бұрын
I'm a bit late to the party, but can anybody tell me why my cursor thing is going crazy? Also, the bullet shoots in the opposite direction. Cheers!
@chenpead
@chenpead Жыл бұрын
ty man i added these to my mobile game but does this work on mobile?
@morebblakeyyy
@morebblakeyyy Жыл бұрын
Will need to use mobile touch api to convert this, have a look through the Unity docs :)
@chesteeer
@chesteeer Жыл бұрын
The only bad thing I noticed is that when the bullet is fired it never disappears, does anyone know how to make it so that when the bullet collides with an object it is destroyed?
@0xff6
@0xff6 Жыл бұрын
just add Destroy(this.gameObject, 5);
@ICatchBullets
@ICatchBullets 10 ай бұрын
I know this is a late response but if you want to make the bullet disappear you will need to do one of two things. Add a float variable to the bullet script that defines the lifespan of the bullet and the create a function to lower that lifespan until it reaches zero and then destroys the object (ie. bulletLifetime -= Time.deltaTime; If(bulletLifetime
@aryanshrivastava4733
@aryanshrivastava4733 Жыл бұрын
but object is not firing
@Yaya0605
@Yaya0605 9 ай бұрын
Better than Brackeys
@EnzoGOAT
@EnzoGOAT Жыл бұрын
It's not working
@donyjunior
@donyjunior Жыл бұрын
This method only works correctly today if u add 180 to rotZ value.
@morebblakeyyy
@morebblakeyyy Жыл бұрын
Not necessarily. Method is the same as release date but more dependant on rotation of your sprite, it’s configurable dependant on the situation
@cgull4546
@cgull4546 Жыл бұрын
thanks bro, i had an issue where the square spawned in a weird spot compared to my mouse, but your comment saved my dumbass hours. it was 270 for me instead but still.
@camburger6397
@camburger6397 Жыл бұрын
i made my script just like yours and my bullets will fire, but they wont move
@hanerez
@hanerez 6 ай бұрын
You probably dont setted the force variable in unity inspector
@Ohbori
@Ohbori 2 жыл бұрын
9:25
@sisupitkanen1693
@sisupitkanen1693 Жыл бұрын
If anyone sees this pls help me my bullets arent moving their just sitting in the air!
@gamesquad6743
@gamesquad6743 2 жыл бұрын
First
@djeka415
@djeka415 2 жыл бұрын
thank you👍
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
Creating SMART enemies from scratch! | Devlog
5:40
Challacade
Рет қаралды 372 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Godot Scripts I add to Every Game
12:34
Aarimous
Рет қаралды 56 М.
How I learned Unity without following tutorials (Developing 1)
18:11
Game Maker's Toolkit
Рет қаралды 2,1 МЛН
I Redesigned the ENTIRE YouTube UI from Scratch
19:10
Juxtopposed
Рет қаралды 728 М.
Improve Your Platformer with Forces | Examples in Unity
7:01
Dawnosaur
Рет қаралды 181 М.
I Scraped the Entire Steam Catalog, Here’s the Data
11:29
Newbie Indie Game Dev
Рет қаралды 598 М.
Using Composition to Make More Scalable Games in Godot
10:13
Firebelley Games
Рет қаралды 252 М.
TOP DOWN SHOOTING in Unity
19:52
Brackeys
Рет қаралды 873 М.
TOP DOWN Movement - Unity Tutorial
16:17
Sasquatch B Studios
Рет қаралды 17 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 67 МЛН