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: