Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 blackaciddevil · Jun 21, 2019 at 11:28 PM · rigidbody.addforcerigidbody.velocitytransform.forward

Why do I get different rigidbody.velocity depending on angle?

I got bullets that are handles with physics by applying force to it. I just noticed that the impact speed is much higher in steeper angles when hitting a collider. I use this muzzleDirection that is gameobject.transform.forward that will represent the muzzle on the rifle.

 _rigidbody.AddForce(this.muzzleDirection * power, ForceMode.Impulse);

I am using rigidbody.velocity.magnitude to get the speed. But as shown in the image (that I could not upload), when hitting something the speed is around 90 m/s when straight ahead and 400+ m/s in steep angles. It should always be around 400 m/s. Any clues?

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 EDevJogos · Jun 22, 2019 at 12:03 AM 0
Share

try normalizing the muzzleDirection.

avatar image blackaciddevil EDevJogos · Jun 22, 2019 at 12:20 AM 0
Share

I have tried that but still getting the same result.

1 Reply

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

Answer by Bunny83 · Jun 22, 2019 at 01:41 AM

What physicsmaterial does the two objects use? What's the bounciness and bounce combine setting of those two materials? A bounciness of 0 will result in an inelastic collision. So all energy along the surface normal will be "absorbed". A bounciness value of 1 will result in a full elastic collision so all energy is reflected.


Though the physics materials are meant to control the collision response. If you just want to know the relative impact velocity you should just use the relativeVelocity of the Collision class

Comment
Add comment · Show 1 · 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 blackaciddevil · Jun 22, 2019 at 10:20 AM 0
Share

This fixed that problem! Thanks! I think used relativeVelocity before, but I remember why I started to use the rigidbody.velocity ins$$anonymous$$d. Thats bacause the relativeVelocity of the Collision class return 0 if the distance is less the around x units. I have tried to wait for the physics to update the relativeVelocity but that gives me the same result as using rigidbody.velocity. Lower straight ahead and higher depending on angle.

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

109 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

Related Questions

How can i initiate an object in parabolic motion without using gravity using Rigidbody2D? 0 Answers

How to move Rigidbody2D on Player a certain amount at a certain speed, for a dash move and knockback? 2 Answers

Adapting Velocity-based Platformer Controls to Camera Forward 0 Answers

how to have a fixed movement using rigidbodies without animations 0 Answers

Rigidbody2D adding force vs modifying velocity for character jump 1 Answer


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