Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 iarebatman · Jun 16, 2012 at 03:54 PM · physicsprojectilearrow

Projectile(Arrow) angle during flight is not realistic

I'm shooting an arrow and I've got a small problem..

The arrow model itself is obeying a decent trajectory, but it doesn't look realistic because the arrow doesn't change angle during flight..

What would be the best way to have the arrow angle upwards a little bit until it reaches the peak of the trajectory, and then begin to angle downwards? If there were some way to tell the unity physics engine the mass of each part of the arrow, I imagine that it may be able to create a more realistic trajectory - but I'm assuming I will have to do this with a MonoBehaviour..

Any help is much appreciated - thank you for your time..

Comment
Add comment · Show 3
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 whydoidoit · Jun 16, 2012 at 03:56 PM 0
Share

When you look at your arrow model in Unity - which of the gizmo axes does it point along?

avatar image iarebatman · Jun 16, 2012 at 04:05 PM 0
Share

It points along the Z axis.

avatar image whydoidoit · Jun 16, 2012 at 04:09 PM 0
Share

And sorry, I forgot to ask - you are using rigidbody or something else to move it?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by whydoidoit · Jun 16, 2012 at 04:15 PM

So this will work in any case:

   var lastPosition : Vector3; 
   function LateUpdate() {
          var direction = (transform.position - lastPosition).normalized;
          lastPosition = transform.position;
          transform.forward = direction;
     }

You could use the rigidbody velocity and dispense with the tracking of the position if you are using physics.

Comment
Add comment · Show 2 · 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
avatar image iarebatman · Jun 16, 2012 at 04:25 PM 0
Share

This seems to cause some odd problems.. Possibly due to how I'm doing other things.. I'll post an update after I've tinkered some more..

Thanks for your help $$anonymous$$ike.

avatar image whydoidoit · Jun 16, 2012 at 04:43 PM 0
Share

Yeah it could well do. You probably want to have the arrow on a separate game object that is a child for this to work.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Projectile motion of an arrow after applying force 3 Answers

Projectile collides, freezes, but flips to weird angle. Help! 0 Answers

Questions about a Bow and Arrow FPS setup 1 Answer

Rotate towards velocity (2D) 2 Answers

Making an arrow Physics without using rigid body 3 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