mirror of
				https://github.com/DerTyp7/grow-ai-unity.git
				synced 2025-10-31 05:17:08 +01:00 
			
		
		
		
	init
This commit is contained in:
		
							
								
								
									
										21
									
								
								Assets/Scripts/PersonMovement.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Assets/Scripts/PersonMovement.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| using System.Collections; | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
| using UnityEngine.AI; | ||||
|  | ||||
| public class PersonMovement : MonoBehaviour | ||||
| { | ||||
|     NavMeshAgent agent; | ||||
|  | ||||
|     private void Awake() | ||||
|     { | ||||
|         agent = GetComponent<NavMeshAgent>(); | ||||
|         agent.updateRotation = false; | ||||
|         agent.updateUpAxis = false; | ||||
|     } | ||||
|  | ||||
|     public void SetTarget(Transform target) | ||||
|     { | ||||
|         agent.SetDestination(target.position); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 j.mei7
					j.mei7