Hi,
This is my first post in unity forums, I’m not a mainstream programmer, but I was trying to code something in 2D the other day and the colliders in the scene wont work as they’re supposed to.
what I want to do is,
When I swipe in any direction(Up, Down, Right, Left only) the gameobject should move in that direction but in a grid like precision. I want to control the no. of units the object moves in one swipe. So I used a variable for the move limit and one for the size of unit movement. My swipe worked nicely, but when I placed another object with a collider in it’s path it won’t collide with it, instead it moves through the object to the target position. I tried, transform.Translate, Mathf.Lerp, tranform.position everything but the result is the same.
Both the objects have 2D colliders and just to be safe I gave both of the, rigidbody2D.
Please tell me how to solve this or an alternate way to move the object so they collide.
Thank you in advance