We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e12d361 commit 1a555e1Copy full SHA for 1a555e1
Assets/Scripts/Docs/UnityEngine/NavMeshAgentExample.cs
@@ -0,0 +1,23 @@
1
+// made with chatGPT
2
+
3
+using UnityEngine;
4
+using UnityEngine.AI;
5
6
+namespace UnityLibrary
7
+{
8
+ public class NavMeshAgentExample : MonoBehaviour
9
+ {
10
+ public Transform target;
11
12
+ private NavMeshAgent agent;
13
14
+ void Start()
15
16
+ // Get the NavMeshAgent component on this game object
17
+ agent = GetComponent<NavMeshAgent>();
18
19
+ // Set the destination of the NavMeshAgent to the target Transform
20
+ agent.destination = target.position;
21
+ }
22
23
+}
0 commit comments