- Home /
How to make different actions using OnMouseDrag with two different colliders on one Game Object.
Hi, I am fairly new to Unity, so any suggestions help.
I am trying to make an app for vector addition. What I am trying to do is create an arrow that I can move, point and scale. I want to be able to click the 'neck' of the arrow to position the tail end of the vector, and I want to be able to click and hold the 'arrow-head' part of the vector to scale and rotate the vector.
I want to use OnMouseDrag() and depending on which of the two colliders (I have a boxcollider2d on the neck of the arrow and a polygoncollider2d on the head of the arrow) that gets clicked, either move the whole vector, or rotate and scale the vector.
I know how to move, scale and rotate the vector, but I just can't figure out a way to do the collider dependant function with OnMouseDrag.
Your answer
Follow this Question
Related Questions
Problem with method Collider2D.isTouchingLayers() 4 Answers
How do I stop characters from standing on top of each other 1 Answer
Player Hit Physics implementation using 2D Animation Frames 0 Answers
How do I set an object's velocity to the velocity of an object that collided with it? 0 Answers
Collision detection problem 0 Answers