hi guys I’m learning about AR in unity several days ago and I have a question How do I spawn object if only a suitable space is available? for example: if the player try to spawn a big object in small place i give him an alert to find a bigger space I’m using Unity 2019.4 Versions: “com.unity.xr.arcore”: “2.1.11”, “com.unity.xr.arfoundation”: “2.1.18”, “com.unity.xr.arkit”: “2.1.9”, “com.unity.xr.management”: “3.2.16”,
You could probably take advantage of the gameobjects renders “bounds”. You can find the min bounds y and max bounds y to find the total height of the object you want to instantiate. Then check that against the total high of the space. Same goes for x and z.
So lookup and read about a meshes “bounds” variable as you can take advantage of this.
Here is a link to get you started: Unity - Scripting API: Bounds
Its either that or keep a running lists of sizes for each object which seems like a bad idea.