Hi guys
I have it working on one object i have but cant get it working the same on another.
im trying to shoot a bullet at the angle of my barrel using this:
newMortar.GetComponent<Rigidbody2D>().AddRelativeForce(Vector2.right * -mortarPower);
but the bullet is just shooting straight from right to left
i tried rotating the spawn point but that didnt work either.
EPOCH! You’re using world Vector2.right… instead use transform.right from the transform of the thing that is tilted.
Is this for your tank barrel? I often throw a “muzzle” transform as a child of my barrel, so I know exactly where to fling the shot from, and since it’s a child it rotates to the right angle too.
strange cause the same code works perfect on my tank…thanks Kurt, will givee it a go.