Simple Shooting | 2D | Bullets | Unity Game Engine

  Рет қаралды 26,523

Unity3D School

Unity3D School

2 жыл бұрын

Copy code from here-
u3ds.blogspot.com/2021/11/sim...
Feel free to Like and Share to show support for this channel.
Don't forget to leave a comment if anything comes to mind.
Have a nice day :)
#unity #csharp #tutorial

Пікірлер: 17
@hectormzt1
@hectormzt1 7 ай бұрын
The best example i found. i really learn to much with this. thank you!
@marcfinger4549
@marcfinger4549 2 жыл бұрын
Straight to the point. Thanks!
@MikaelL
@MikaelL Жыл бұрын
Thanks to you and to this tutorial I understood how to shoot bullet🙂
@BRUCESHARKYT
@BRUCESHARKYT 23 күн бұрын
how to make obstacle respawn?
@leonedandrewTumbaga
@leonedandrewTumbaga Жыл бұрын
anyway got mine so i declare two empty object named left and right and i base on character movement so in update i put this the one empty object i manually rotate Y into 180 "left one" //bullet public Transform bulletSpawnPointRight; public Transform bulletSpawnPointLeft; public GameObject bulletPrefab; public float bulletSpeed = 10; void Update() { if ((horizontalMove = .1f)&& (Input.GetKeyDown(KeyCode.A))) { charactermove.SetTrigger("shoot"); Invoke("shootright", 1f); } void shootleft() { var bullet = Instantiate(bulletPrefab, bulletSpawnPointRight.position, bulletSpawnPointRight.rotation); bullet.GetComponent().velocity = bulletSpawnPointRight.right * bulletSpeed; Debug.Log("throwleft"); } void shootright() { var bullet = Instantiate(bulletPrefab, bulletSpawnPointLeft.position, bulletSpawnPointLeft.rotation); bullet.GetComponent().velocity = bulletSpawnPointLeft.right * bulletSpeed; Debug.Log("throwleft"); } }
@believe113
@believe113 6 ай бұрын
Best video.Thanks Man helped alot.🙏
@YubisSmileStudio
@YubisSmileStudio 2 ай бұрын
thank you very much and One Big Like ;)
@Marc-eq2bi
@Marc-eq2bi 13 күн бұрын
Thank you very much
@leonedandrewTumbaga
@leonedandrewTumbaga Жыл бұрын
i used this but instead of up i use right, now my problem is left
@ppproto7029
@ppproto7029 3 ай бұрын
Great!
@Kihaiwo
@Kihaiwo Жыл бұрын
Thanks
@JJ-qo1ws
@JJ-qo1ws 7 ай бұрын
How to make it shoot 180 degrees?
@prinolangovender4094
@prinolangovender4094 4 ай бұрын
You can try something like this: var bullet = Instantiate(bulletPrefab, bulletSpawnPoint.position, bulletSpawnPoint.rotation); // Get the player's movement direction Vector2 playerDirection = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")).normalized; // Set the bullet's initial velocity based on the player's direction bullet.GetComponent().velocity = playerDirection * bulletSpeed;
@Jay-ov4qo
@Jay-ov4qo Жыл бұрын
For some reason this didn’t work the code had no errors I did everything right, but what I have to shoot with SpaceBar? What do I have to shoot with?
@reactor230
@reactor230 Жыл бұрын
Spacebar yes
@miaw1232
@miaw1232 Жыл бұрын
How to make the bullet go to right
@feelgxxd
@feelgxxd Жыл бұрын
transform.Translate(Time.deltaTime * bulletSpeed * transform.right);
Simple Shooting | 3D | Bullets | Unity Game Engine
3:33
Unity3D School
Рет қаралды 82 М.
2D Bullet / Projectiles in Unity / 2023
6:33
Distorted Pixel Studios
Рет қаралды 54 М.
Когда на улице Маябрь 😈 #марьяна #шортс
00:17
Barriga de grávida aconchegante? 🤔💡
00:10
Polar em português
Рет қаралды 49 МЛН
Unity 2D Platformer Tutorial 29 - Shooting Mechanics
13:09
Antarsoft
Рет қаралды 10 М.
Testing 8 Innovative New Boat Propeller Designs
24:08
rctestflight
Рет қаралды 316 М.
2D Player Movement In Unity
5:34
bendux
Рет қаралды 386 М.
3 Ways to Shoot Projectiles in Unity!
23:07
Code Monkey
Рет қаралды 237 М.
TOP DOWN MOVEMENT in Unity!
22:30
Brackeys
Рет қаралды 1,2 МЛН
SHOOTING with BULLETS + CUSTOM PROJECTILES || Unity 3D Tutorial (#1)
9:25
Dave / GameDevelopment
Рет қаралды 188 М.
Fire PROJECTILES in UNITY
11:17
BMo
Рет қаралды 27 М.
Idle, Run and Jump Animations - Platformer Unity 2D
10:13
Game Code Library
Рет қаралды 23 М.
OpenAI’s GPT-4o: The Best AI Is Now Free!
9:14
Two Minute Papers
Рет қаралды 197 М.