villager animations
This commit is contained in:
		
							parent
							
								
									b310830c9d
								
							
						
					
					
						commit
						429b91facf
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -34,6 +34,7 @@ func _process(_delta):
 | 
			
		|||
	
 | 
			
		||||
	match task:
 | 
			
		||||
		"idle":
 | 
			
		||||
			idle()
 | 
			
		||||
			task = rng.randf_range(0, 100)
 | 
			
		||||
			
 | 
			
		||||
			# 3% chance to walk somewhere.
 | 
			
		||||
| 
						 | 
				
			
			@ -51,6 +52,7 @@ func _process(_delta):
 | 
			
		|||
				task = "idle"
 | 
			
		||||
		
 | 
			
		||||
		"walk":
 | 
			
		||||
			walk()
 | 
			
		||||
			# Get the direction to the target in z-x plane.
 | 
			
		||||
			target_direction_xz = (location_xz.direction_to(target_location_xz) * Vector3(1, 0, 1)).normalized()
 | 
			
		||||
			
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue