i’m working with the new ar-foundation-samples and facing a problem with the ar-object rotation when i place it on a vertical plane. If i build the exactly same scene (SampleUXScene) to both platforms (iOS & Android)…so on iOS it’s working like expected (see picture “what i want”) and on Android something went wrong like on the picture “what i get”. The up-vector is facing the Camera but it rotates also around the up-vector-axis!
The same happens also placing an object on a horizontal plane!
So what’s the difference between iOS and Android? Is Android or ArCore interpreting something wrong? Because on iOS it’s working correctly! Any ideas how to fix this problem?
I’ve recently had to face the same problem and here is my solution.
I found that it actually takes 2 steps to get the picture onto the wall.
You need to put the picture onto the plane found by AR Foundation.
Then, rotate the picture so that it is parallel to the floor.
My GetWallPlacement() method finds those two rotations.
Here is my code. For the first part, replace what you have on your inner if statement (where you do the raycast) with my suggested if statement and that will call the method GetWallPlacement(…)
One difference between your example and mine, is that my prefab has positive Z at the top of the picture and it looks like you had Z+ pointing down. I think you could probably adapt that for your needs by replacing Vector3.down in my method to Vector3.up.