Topic: Strange interaction with phone gyroscope and NavMeshAgent
Hi. I have one interesting thing happening and looks like Online Maps asset is a reason of this.
Whats happening:
When I move marker in Update() with :
navAgent.Move(moveDirection * moveSpeed);
it works perfectly fine on PC, but when it comes to mobile devices - it does not work correctly: marker moves some distance then if I change phone physical position (tilt a little or lift up/move down) marker instantly snaps back to it's starting point.
Why do I think that it is because of OnlineMaps? Because if I add following lines:
Vector2 playerGeoPosition = OnlineMapsTileSetControl.instance.GetCoordsByWorldPosition(player.transform.position);
playerMarker.position = playerGeoPosition;
marker snaps not to the starting position but to the position that was set by this code.
I do understand why it might snap it's position but why does it snap each time phone gyroscope values change(If I get it right)?
P.S. Don't know why but I've attached screenshot of Map and it's components.