petrepa / TFE4580

Specialization project for my master thesis at NTNU
2 stars 0 forks source link

Virtual chair moves when task buttons are pressed 🕹 #19

Closed petrepa closed 4 years ago

petrepa commented 4 years ago

When the user are pushing the task buttons, the SpawnObject-script thinks this is a valid time and place to move the chair. Should try to implement a way to avoid this.

petrepa commented 4 years ago

Fix 🥳

Adding this to the update() of SpawnObjectOnPlane.cs made sure the touch didn't go through other gameObjects

if (EventSystem.current.IsPointerOverGameObject() || EventSystem.current.currentSelectedGameObject != null) {
    return;
}

Solution found in the unity forums