1
votes

I am working on an application that uses horizontal surfaces in AR. I don't have much experience with Unity but I was able to create automatically generated planes with which objects can collide (example: a falling and rolling dice). Unfortunately, sometimes such objects fall outside the plane area and fall into the void.

I would like to create something similar to invisible walls around the detected plane to keep the objects inside the plane.

Plane configuration i am currently using:

AR Plane prefab used.

Application:

Application context

Edges of plane are marked with red line.

1

1 Answers

1
votes

I think the term for what you are trying to do is geo-fencing. The easiest example is to put a square around the area your objects are contained where you have four conditions, one for each edge, like if objectX >= edgeX then objectX = edgeX and so forth. To do that in Unity you would probably have to mess with that C# language.