Search Unity

MouseOrbit with UI Slider problem

Discussion in 'Scripting' started by blamejane, Mar 5, 2015.

  1. blamejane

    blamejane

    Joined:
    Jul 8, 2013
    Posts:
    233
    I have a simple garage scene with a truck in the center. I'm using the standard MouseOrbit script for rotating around the vehicle. It works great however I'm trying to implement a UI Slider to move essentially "lift" the truck on the y axis. When I move the slider, the camera is moving around the target. Same kind of thing happens when I push buttons on the screen, it effects the orbiting a little if I inadvertently drag a little in my click.

    Basically I want to restrict the UI controls from passing events to MouseOrbit. Can anyone give me an idea on how to block the UI events?

    I did try some research, which led me to what I thought was going to solve my problem, but I'm at a loss. Here's the solution I was trying to use:

    http://answers.unity3d.com/questions/16774/preventing-mouse-clicks-from-passing-through-gui-c.html

    Thanks.