one of the ways to do this is by using the military way i.e. by using 3D Radars. But, it is quite difficult and expensive to build one.
But one of the cheaper and more interesting way is by using Beacons. Beacons are small devices used mostly for indoor mapping and tracking. You can place minimum 3-4 beacons in your room which will transmit BLE and WiFi signals.
The object you say which will enter the room will have a WiFi and BLE scanner or a sensor, which will connect to these signals. Depending upon the RSSI i.e. the Received Signal Strength from each of the beacons you can identify the location of your object.
This method is called Triangulation Method.

ESP32 is one of the best device you can use for this. You can find some details here
You can also use accelerometer and gyroscope sensors to map the positioning. You can find some reference here:
https://pdfs.semanticscholar.org/cd3d/88d9f942deb245d5797a2135d3dfa757da13.pdf
https://www.diva-portal.org/smash/get/diva2:475619/FULLTEXT02.pdf
I have a sensor X, which I use to detect object Y. How do I restrict the sensor X, so that the object Y is detected only on the left side of line W?
$\endgroup$ – jsotola Jun 24 '18 at 22:38