Shooting projectiles in 2D world

HI all,

i feel i bit dumb here but forgive me since unity 2D is new to me…

in 3D when i wanted to shoot projectile in any angle i just instantiate it and the projectile inherit the spawn object rotation. then all i had to do is to advance the projectile in Vector3.forward (which is Z axis). but now in 2D Vector3.Forward is useless. how do i get the same effect of shooting projectile in the player angle?

i prefer using Transform.translate then Rigidbody2D.addforce…

thanks!!!

It depends on what your “forward” direction is…if the object’s natural “forward” is up (that is, you drew the player sprite that way), then use Vector3.up, and if it’s right, then use Vector3.right.

OK… as always… my fault! it seems that the projectile didn’t get the rotation after all.
maybe because of the pool system i use. any why, i fixed the rotation and now it works with vector2.right.

thanks!