added Enemy

This commit is contained in:
2023-06-25 17:58:03 +03:00
parent e972ae1d8c
commit 8aa23191d6
3 changed files with 34 additions and 6 deletions
+1 -2
View File
@@ -29,12 +29,11 @@ public class Character : MonoBehaviour
{
var groundCheck = Physics2D.BoxCast(_boxCollider.bounds.center, _boxCollider.bounds.size, 0f, Vector2.down, .1f, groundLayer);
float h_movement=0;
float v_movement=0;
if (groundCheck || _isOnLadder)
{
_isFall = false;
h_movement=inputHorizontal ;
float h_movement = inputHorizontal;
if (h_movement > 0 && !_facingRight)
{
FlipCharacter();