This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
This script is created by Şahin Kasap (github.com/sahin52) | |
This script contains an example for smooth and clean dragging when colliders exist on a scene. | |
Normally, when we just add dragging functionality, even though the colliders exist, the objects passes through colliders | |
(there becomes a small bumb but it is not enough), so I added the colliders tags, and added the tags to a List. | |
If the collider is in the list and the mouse position is on the other side of the collider, I make the velocity to the other position 0. | |
Not a perfect solution but works fine in my case. | |
*/ | |
using System.Collections.Generic; |