Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Object Snapping

Discussion in 'Scripting' started by ArtLove, May 25, 2015.

  1. ArtLove

    ArtLove

    Joined:
    Oct 16, 2012
    Posts:
    49
    Good evening!

    I currently have a project where players can gathers blocks and cylinders and use them to construct "things".

    A video of what I'm trying to do:


    So what I am trying to accomplish is having a player pick up parts, bring them into contact with others, and have their position and orientation snap into place.

    What I tried is having the object picked up follow the camera in front. Then when one of its nodes touches another, it's position gets changed. The method isn't as smooth as the one on the video and doesn't work well at all.

    I'm looking for suggestions or possible a code snippet. Thank you!
     
    Last edited: May 25, 2015