Skip to content

Instantly share code, notes, and snippets.

View sahin52's full-sized avatar
🏠
Working from home

Sahin Kasap sahin52

🏠
Working from home
View GitHub Profile
<!-- SEO / Google -->
<meta name="author" content="Author name here....">
<meta name="description" content="Description text here.....">
<link rel="canonical" href="URL here...">
<!-- Social: Twitter -->
<!-- After inserting META need to validate at https://cards-dev.twitter.com/validator -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@8bit_code">
<meta name="twitter:creator" content="8bit_code">
/**
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;