feat: enemies now rotate with movement
This commit is contained in:
		
							parent
							
								
									526f756736
								
							
						
					
					
						commit
						1b0e4384b9
					
				| 
						 | 
					@ -13,6 +13,9 @@ void EnemyBody::physics_process(double delta) {
 | 
				
			||||||
	GETSET(velocity, {
 | 
						GETSET(velocity, {
 | 
				
			||||||
		velocity = Vector3{ this->movement_direction.x, velocity.y, this->movement_direction.y };
 | 
							velocity = Vector3{ this->movement_direction.x, velocity.y, this->movement_direction.y };
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
						if (!get_velocity().is_zero_approx()) {
 | 
				
			||||||
 | 
							look_at(get_global_position() + get_velocity());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	move_and_slide();
 | 
						move_and_slide();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue