mesh-collider

how to snap two objects in runtime in unity?

心已入冬 提交于 2019-12-08 06:03:49
问题 this is the 3d model i wanted to connect another model like this to its silver connectors on top side and also another model to right side(so do help me to snap it)I want to know how to snap two 3D objects together in runtime. i.e during "play" the user must be able to dragup, down, left, right to snap one object with the other object .for example like "lego", ie. one 3D object should snap to another 3D object. How would I achieve this? This is the code I use for dragging: using System