Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使物体移动到指定经纬度处,物体移动到了其他地方 #63

Open
llliao104 opened this issue Feb 14, 2020 · 0 comments
Open

Comments

@llliao104
Copy link

llliao104 commented Feb 14, 2020

我遇到的问题

调用GeoToWorldPosition这个方法,输入经纬度,为什么点没有移动到相应的位置呢,我输的经纬度对应的是New york,但是它移动到其他地方去了

我遇到的问题截图

public class moveWaypoint2 : MonoBehaviour {
public InputField Position;
private Vector2d getLatlon;
private Vector3 target;
public float speed;
[SerializeField]
AbstractMap map;

// Update is called once per frame
void Update () {
    Position = GameObject.Find("inputTest").GetComponent<InputField>();
    getLatlon = Conversions.StringToLatLon(Position.text );
    target=map.GeoToWorldPosition(getLatlon);      
    gameObject.transform.localPosition = Vector3.MoveTowards(gameObject.transform.localPosition, target, speed * Time.deltaTime);        
}

该问题的类别

Unity

@llliao104 llliao104 changed the title 使物体移动到指定经纬度处 使物体移动到指定经纬度处,物体移动到了其他地方 Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant