- Home /
Trying to get actual good arrow physics in 2D
Hello, I have a 2D game that you can shoot arrows. To do this, I have 2 sprites for my arrow asset, I have an arrowhead and an arrow body glued together with Fixed Joint 2D.
The arrow head and the arrow body have their own Rigidbody2D and Collider2D. However, I'm trying to have atleast a somewhat realistic physics so the arrow head is top heavy and leads the arrow.
Here is a GIF of the arrow physics I have now
As you can see, the arrow kinda has some realistic physics midway but shooting straight up the arrow does not turn towards the arrow head, here at the settings for each of the rigidbody
Arrowhead components ^
Arrowbody components ^
It's been a lot of trial and error adjusting the drag, mass, and gravity of both items, my standard gravity scale is 2.5 for the sake of the player physics feeling better.
What should I change to accomplish better arrow physics? Is there a better approach for having arrows?
Have you tried lowering the mass of the arrow shaft to 1 (since the head should be heavier) and raise the linear drag to 75 (to mimic air resist)?
I did give this a try, the arrow does perform a bit better, but the arrow now kinda looks like a parachute, would it just be a change of lower linear drag? Should I have the gravity scale different or the same on both objects?
EDIT: I think I just answered my own question, thanks
Answer by RevivingSociety · Aug 20, 2020 at 05:29 PM
The arrow has 2 points to it, the arrow head and the arrow body. The arrowhead is heavier than the body for it to fly straight.
Here is the component with the arrow head and arrow body:
Arrowhead Rigid ^
Arrowbody Rigid ^
What I learned here is Mass plays a bigger roll than I though, the arrow body is at 1 and head 5x masser, lowering the head mass makes the physics behave weird and this is the sweet spot I found for it. I would rather have a consistent gravity scale so they are the same based on my player gravity scale. Linear drag plays more of a part in the body to simulate air and I figure angular drag can help with the realism (You can correct me on this though I don't actually know how an arrow works)
Speed at which arrow is show it handled by a script on the camera that helps it shoot in the right direction
Here is a gif of the result I am happy with, tweaking to preference of course