1. Home
  2. Docs
  3. GO Map – Documentation
  4. Avatar
  5. GPS Mode

GPS Mode

MoveAvatar.cs

To enable this mode you have to select “GPS” under “motionMode” in the LocationManager inspector. In this way the location manager gets the location coordinates from the GPS device of your smartphone, converts them into unity vectors, and tells GoMap to build the terrain tiles.

Your avatar group has to have the “MoveAvatar.cs” component attached to it and linked with LocationManager and your character prefab.

Basically when the app is running it works like this:

  1. Location manager receive the location updates from unity GPS apis and sends events to the registered classes: GOMap and MoveAvatar.
  2. GOMap builds the nearby map.
  3. MoveAvatar receives the new user’s currentLocation and converts it to Vector3.
  4. The linked character is rotated accordingly to the motion direction.
  5. The main camera keeps orbiting the character on the xz plane.

Was this article helpful to you? Yes No

How can we help?