Hello,
I’m at Leaping Coyote (www.leapingcoyote.com) right now, working on an iOS game that uses GPS. It looks like a bug crept into Unity 4.0 that gives bad values for the GPS data. If you’re seeing the same thing, here is how to solve that:
open up iPhone_Sensors.mm
Look for the code that calls UnitySetLastLocation. Notice how the timestamp is the last parameter? It should actually be the first parameter. Here is the rewritten section:
// Delegate method from the CLLocationManagerDelegate protocol.
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
gLocationServiceStatus.locationStatus = kLocationServiceRunning;
UnitySetLastLocation([newLocation.timestamp timeIntervalSince1970],
newLocation.coordinate.latitude,
newLocation.coordinate.longitude,
newLocation.altitude,
newLocation.horizontalAccuracy,
newLocation.verticalAccuracy);
}
Cheers.