Created
November 6, 2016 16:55
-
-
Save KangYoosam/ad492d28299ce0f9aaf1dd9966f431fd to your computer and use it in GitHub Desktop.
Navmeshでターゲットの方向へ向かっていく
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Move : MonoBehaviour { | |
public GameObject target; | |
void Start () { | |
NavMeshAgent agent = GetComponent<NavMeshAgent> (); | |
agent.speed = 1;//このようにスクリプトからNavMeshのプロパティをいじれる。 | |
agent.destination = target.transform.position; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment