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 highpockets · Jul 07, 2013 at 07:35 AM · lerpvector2normalscollisions

Collisions while using Vector2.Lerp

Hi,

I was hoping that someone could point me in the right direction here. I have tried numerous approaches to find a solution for stopping my player object from moving through another object while using Vector2.Lerp. I recently found that finding out the contact point normals of the other object in the collision can tell me which way the player object should not be able to pass through. I was wondering if there was a function or something that I missed that would at least help ease the pain..

Does anybody have any insight to share?

Thanks in advance.

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 SinisterRainbow · Jul 07, 2013 at 09:24 AM 0
Share

can you explain more in depth. If you are detecting using OnCollisionEnter or stay I don't understand the question, as it already tells you you've collided. If not, are you intending to compare meshes (super expensive)? why are you moving via vector2.lerp rather than by addforce? Lerping and not using built-in collision detection confuses me. How exact are you intending your collision to be - does it need to be that precise, i mean are you doing a science application for a NASA $$anonymous$$oon landing or an 8-bit 2d scroller?

avatar image highpockets · Jul 07, 2013 at 04:27 PM 0
Share

I need my movement to be super precise because the player object needs to pick up objects and place them on top of other objects. Lets say each object has a piece of a picture and by placing the objects on top and beside one another completes the picture, so precision counts when moving and this is why I'm using Vector3.Lerp with iskinematic rigid bodies rather than rigid bodies with non kinematic checked because it's near impossible to get precise movement with rigid bodies.

On the other hand, detecting collisions and stopping movement in only one direction has been very difficult to figure out. $$anonymous$$y player object has to weave through obstacles to make it to different locations and when it hits something, I don't want it to stop, but I just want it to stop movement in that direction.

Anyways, I think I'm going to try non kinematic rigid body with addforce until the player object gets close enough to the desired location and then I will switch to iskinematic and Lerp. It should work.... I'm hoping... I better hurry, NASA is counting on me for this 8 bit scroller!!

0 Replies

· Add your reply
  • Sort: 

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

16 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

Related Questions

Limit Lerp Distance From Target 1 Answer

Is there an easy way to find out exactly where a game object was hit in a collision (top, bottom, upper left, etc.)? 0 Answers

How to get click position in Vector 2 ? 1 Answer

I'm Having Trouble With Vector3.Reflect.. Please Help? 1 Answer

Why doesnt Vector2.Lerp work? 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