- Home /
Changing the Mouse's Range for OnMouse events
I am working on a project where a button is located far away from the elevator. Once the button is clicked (OnMouseUp) the elevators animation is activated.
I want to know how would I shorten the distance the mouse requires to activate the buttons script.
In the Image 1 below, I want it where my character must be within a few feet in order for the script to activate, but as of now Image 2 shows that even that far away I can click the button and the elevator moves.
Also would this way shorten the range for all the Mouse events such as OnMouseOver and OnMouseExit?
IMAGE 1:
IMAGE 2:
Heres my code:
function OnMouseUp() {
elevator.animation.Play("Elevator");
}
Your answer
Follow this Question
Related Questions
OnMouseOver Problem 3 Answers
Multiple GUI textures one script 2 Answers
OnMouseDown 2 Answers
Making a tray GameObject that slides out on mouse over 1 Answer
Can't seem to get OnMouseExit and Destroy(GameObject) to work properly 1 Answer