Skip to main content
added 287 characters in body
Source Link
starikcetin
  • 5.3k
  • 4
  • 27
  • 60
Instantiate(bullet, guntip.position, guntip.rotation);

You need to inherit rotation of guntip to make bullets face that way.


To make bullet go towards the direction it's facing, if your 2D setup is top-down:

 MyRB.AddForce(transform.up * rocketSpeed, ForceMode2D.Impulse);

If your 2D setup is side-scroller:

 MyRB.AddForce(transform.right * rocketSpeed, ForceMode2D.Impulse);
Instantiate(bullet, guntip.position, guntip.rotation);

You need to inherit rotation of guntip to make bullets face that way.

Instantiate(bullet, guntip.position, guntip.rotation);

You need to inherit rotation of guntip to make bullets face that way.


To make bullet go towards the direction it's facing, if your 2D setup is top-down:

 MyRB.AddForce(transform.up * rocketSpeed, ForceMode2D.Impulse);

If your 2D setup is side-scroller:

 MyRB.AddForce(transform.right * rocketSpeed, ForceMode2D.Impulse);
Source Link
starikcetin
  • 5.3k
  • 4
  • 27
  • 60

Instantiate(bullet, guntip.position, guntip.rotation);

You need to inherit rotation of guntip to make bullets face that way.