Quantcast
Channel: Babylon.js
Viewing all articles
Browse latest Browse all 388

How to listen to a click anywhere on scene except for certain objects

$
0
0

Hi all!

 

In my game

 

http://quantuminformation.github.io/Density-Wars/

 

You can select units by clicking on them and a bounding box shows it as currently selected.  If a user clicks anywhere on scene I want to deselect them. Obviously I can listen to canvas click natively but that won't tell me if no unit is under the mouse.

 

What is my correct strategy?

 

As a bonus does anyone know a good tweening lib for moving from (x1,y1) to (x2,y2). Basically I want to have a a unit acceleration to top speed and deceleration approaching end point.


Viewing all articles
Browse latest Browse all 388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>