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 Slin · Jul 23, 2010 at 02:49 PM · collisioncollidertriggerspeedcontact

Collision without physical behaviour.

Ive got some quite big object, which uses a box collider. I want to translate and rotate this object including collision detection at a quite high speed. What I do now is, that the object to collide with has a mesh collider attached and the moving object has its box collider and a rigid body as components. I move the object using transform.Translate(), it works kinda okay at low speed, but the object keeps sliding after collision in a kinda strange way. At higher speed it tends to drive crazy on collision. Any ideas on how to get this to work stable? And I also wonder and ask you now: how to get information on the actuall movement my object did when executing the Translate? As I basicly need the actual direction and distance.

My alternative approach is setting the object to kinematic and the environment as trigger. I can than use the OnTrigger events to code the collision behavior myself. The problem here is that I need some information about the collision point like position and normal. I could get some normal by casting a ray, but I need some direction for the ray and just using the movement direction would give me wrong results in most cases.

I hope for some helpfull ideas :) Thanks.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by StephanK · Jul 23, 2010 at 03:17 PM

Using transform.Translate() is not recommended when dealing with rigidbodies, as this circumvents the physic engine. You are able to move to objects so they completly intersect each other. Then in the next physic update the physic engine will apply forces to solve this intersection. This might result in the behaviour you mentioned. (going crazy) The "correct" way to move your object would be either to apply forces, or for a more direct control modify its rigidbody.velocity. rigidbody.velocity is also the way to get the current direction and speed.

If that also doesn't help try changing the update rate of the physics engine using Project Setting -> Time -> fixed Timestep.

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 Slin · Jul 23, 2010 at 05:14 PM 0
Share

Thanks for your answer. I am now trying to set the velocity directly. I basicly have a small wall of about 3/4th the height of my box collider and move my object with the box collider against that wall. I just want it to stop but ins$$anonymous$$d it starts moving up and finally kinda explodes, as it moves up at a very height speed as soon as it got above the wall. The makes than when one thinks about how such a physicsengine works, but how to fix that?

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

No one has followed this question yet.

Related Questions

Collission and Trigger on Same object 0 Answers

Trigger if 3 Objects Collide at the same time 0 Answers

overlapsphere to destroy NPCs on exit 1 Answer

OnTriggerEnter Not Working 3 Answers

OnTrigger AI projectile detection and turn. 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