Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by RevivingSociety · Aug 20, 2020 at 02:45 AM · 2d gamerigidbody2d2d-physicsfixedjoint

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

Imgur

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 ^

Arrowhead components ^

Arrowbody 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?

arrowhead.png (44.0 kB)
arrowbody.png (25.3 kB)
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Ymrasu · Aug 20, 2020 at 04:43 AM 1
Share

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)?

avatar image RevivingSociety Ymrasu · Aug 20, 2020 at 04:49 PM 0
Share

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?

Gif of suggested changes

EDIT: I think I just answered my own question, thanks

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

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

Arrowhead Rigid ^

Arrowbody

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


arrowbodygood.png (28.7 kB)
arrowheadgood.png (26.8 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

176 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Need suggestion for tossing game 0 Answers

Change a specific Gameobjects rigidbody gravity to horizontal (left) 1 Answer

2D Character won't jump diagonally 1 Answer

Physics for multiple connections - advice needed 0 Answers

2D game - Sprite deformation when add frce 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges