- Home /
Dragging between two gameobjects
In my game the player needs to drag a path between two game objects. My plan was to have the game objects have a OnMouseDown funtion that sets the start point of the path and a OnMouseUp command to set the end point. The proplem is the OnMouseUp command is run for the same object that was first clicked on. Not the object the mouse is currently over.
Can anybody think of a way to do this?
Answer by demize2010 · May 26, 2011 at 07:01 PM
You need to have a central user input controller and do raycasts to determine what is clicked on and what is clicked "off" ;)
Your answer
![](https://koobas.hobune.stream/wayback/20220612085916im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Android Action Button 2 Answers
Checking whether string is a valid Input.Key 1 Answer
Unity config file/or reg key 1 Answer
Raycast based on a Rect? 1 Answer