Following some example code i am using the code below to rotate an object to be aligned with the current phone tilt/rotation.
The problem is that when i tilt/rotate the phone left then the object i’m rotating rotates right. Meaning that the object does not rotate the same way the phone rotates. I have tried a lot of different solutions to fix it, but nothing has worked.
Does anybody have any idea how i can fix it to make it match the phones rotation/tilt?
var temp = MovAverage(Input.acceleration.normalized);
temp.z = 0;
foreach (var t in GameMaster.CurrentTiles)
{
if (t == null) return;
t.transform.up = temp.normalized;
}