- Home /
Need help. Rotation interfering with mouseDrag or touch moved
I have a GameObject that drag on the scenario , however, when I run a touch event on another object and another object that performs a spin, my object I was dragging , does not allow me more drag.
Code to drag my object Bubble:
void OnMouseDrag() {
touchPosition = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10));
player.position = new Vector3(touchPosition.x, touchPosition.y, touchPosition.z);
}
Code to rotate my other object:
void OnMouseDown() {
GameObject.Find("platform01").transform.Rotate(Vector3.forward * 20);
}
Once I click on my other object , I can no longer drag my bubble object.
[1]: /storage/temp/46393-screen-shot-2015-05-14-at-74723-pm.png
Comment
Your answer
