We have some problem of shooting bullets...

Hello,everyone.

This time,our school project we hope can make a game like “Angey Brid”.

But,our bullet have some problem.
I don’t know how to say…(Sorry…my English is not so good…)

So, I use a image to say.

This is our problem…

Frist picture is now our situation when we shooting bullets.

We hope can make to like second picture.

So…have any way or idea can help we solve this problem?
Thanks.

(P.S. We use unity3.1)

Your first picture is how a physics object will normally move if it’s ‘thrown’; that is, its orientation will remain fixed as it moves.

To get behavior like in your second picture, you’ll have to take extra steps to make it happen. I’ve never implemented this effect myself, so I can’t offer you a ‘sure-fire’ solution, but here are a few options:

  1. Apply a ‘realistic’ force or torque to the object as it moves to simulate the forces that cause real-life objects (such as arrows) to change orientation as they fly through the air.

  2. If you know about how long the ‘flight time’ will be, you could simply rotate the object directly as needed.

  3. You could rotate the object each update (or fixed update) so that it’s aligned with its velocity. This might be the easiest and most effective solution, and is probably what I’d try first.

I think #3 is the best choice, get the vector of movement and then angle your object accordingly.

Just a quick Idea, not sure if this will work.

But you could change the CenterOfMass.

See the documentation here:
http://unity3d.com/support/documentation/ScriptReference/Rigidbody-centerOfMass.html

Test it out and let me know =)

if you are using a rigidbody for movement:

transform.rotation = Quaternion.LookDirection(rigibody.velocity);

Yes, this is what I and JRavey suggested earlier.

(Note that the above code could lead to problems if the object goes more or less straight up or down or if the velocity has small magnitude. If it can be guaranteed that those situations won’t occur though, the above should work.)

Thank you everyone.
You helped a great favor for us.

Thank you very much :slight_smile: