- Home /
Question by
Content1of_akind · May 08, 2019 at 12:52 AM ·
gameobjectspriteunity 2dtouchscreenclick and drag
How click and drag a 2D game object without click and dragging the Camera Orthographic?
I have it to where you can click and drag both the 2D game object and camera. I want this but How do I move only the object when I click and drag(also touch and drag for android importantly) it and still have my camera staying in place?
Comment
Best Answer
Answer by Content1of_akind · May 08, 2019 at 01:03 AM
I fixed it by adding a bool called touchingObject over all the Camera touch code, using an if statemet. if(touchingObject == false){ //Move Camera code}. In the 2D gameObject I made touchingObject = true when MouseDown() and touchingObject = false when MouseUp().