The best example i found. i really learn to much with this. thank you!
@marcfinger45493 жыл бұрын
Straight to the point. Thanks!
@MikaelL2 жыл бұрын
Thanks to you and to this tutorial I understood how to shoot bullet🙂
@Harekrishna2666 Жыл бұрын
Best video.Thanks Man helped alot.🙏
@leonedandrewTumbaga2 жыл бұрын
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"); } }
@leonedandrewTumbaga2 жыл бұрын
i used this but instead of up i use right, now my problem is left
@YubisSmileStudio11 ай бұрын
thank you very much and One Big Like ;)
@JJ-qo1ws Жыл бұрын
How to make it shoot 180 degrees?
@prinolangovender4094 Жыл бұрын
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;
@EmeraldGamin20248 ай бұрын
how to make obstacle respawn?
@BGMI143223 ай бұрын
Bro bulle5 fire nhi ho rhi h
@marcdrechsel8 ай бұрын
Thank you very much
@ppproto702911 ай бұрын
Great!
@Blank87675 ай бұрын
the bullets just fall on the ground
@Kihaiwo Жыл бұрын
Thanks
@Jay-ov4qo2 жыл бұрын
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?