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
1
Question by demize2010 · Apr 19, 2011 at 01:40 PM · collisionanglenormal

Collision Normal

Hey guys,

Is there anyway to return the normal angle of a collision?

I've done some searching but really struggling to find a solution.

Thanks in advance!

-Jack

edit

Sorry the purpose is to rotate the other object away from the collision ;)

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
3
Best Answer

Answer by poncho · Apr 19, 2011 at 01:50 PM

with a Collision object use the collision.contacts[0].normal if there are more contact points you could use them, but usually the first one is the one you need

example

void OnCollisionEnter(Collision collisionInfo)
{
   Vector3 myCollisionNormal = collisionInfo.contacts[0].normal;
}
Comment
Add comment · Show 4 · 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 demize2010 · Apr 19, 2011 at 02:33 PM 0
Share

Thanks! I had a feeling I was missing something obvious.

avatar image groovecode · Apr 19, 2011 at 05:34 PM 0
Share

Is that the normal to the current objects collider at the contact point? Or the other object's?

avatar image poncho · Apr 19, 2011 at 07:31 PM 0
Share

is the normal of the contact point of the object that is subscribed to the script

lets say i had a ball with this script, i detected the collision, and the normal will have the normal vector of the surface i got the collision with, hope i explained myself

avatar image Nony42 · Sep 24, 2013 at 08:24 PM 0
Share

This is exactly what I was looking for. However, being new I don't know enough of the context to be able to use this. Could you help out?

Say for instance I have a player object and a wall object, how would I use this to find the normal angle of the wall object when the player object collides with it?

Could I make this function return a Vector3 so i can add it to the player object?

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

1 Person is following this question.

avatar image

Related Questions

Collisions, Getting the Normal of the Collision Surface (Not the Angle of Impact) 1 Answer

Get angle to retarget collision object. 1 Answer

Obtaining contact point and normal of first object in collision 0 Answers

Average of Normals 1 Answer

exact vector reflection along collision normal vector 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