안녕하세요


유니티 2D 프로젝트 만들고 진행하다가 캐릭터가 도중에 멈추는 현상이 발생해서 프로젝트를 갈아 새로 만든 적이 있습니다


그런데 새로 만든 프로젝트에서도 동일한 현상이 발생하여 구글링을 하여 오류를 찾으려고 했지만, 저와 비슷한 문제를 가진 분들이 많이 계신 것을 확인하고


몇 가지 방법을 실행했지만 오류가 지속적으로 발생하여 질문드려요 


진짜 미처 화병 날 지경입니다 도와주세요 



7cf3c028e2f206a26d81f6ec4388736d


--





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
cusing System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class PlayerMove2 : MonoBehaviour
{
    private float maxSpeed = 4.5f;
    private float jumpPower = 15f;
    private Rigidbody2D rigid;
    private SpriteRenderer spriteRender;
    private Animator anim;
 
    private void Awake()
    {
        rigid = GetComponent<Rigidbody2D>();
        spriteRender = GetComponent<SpriteRenderer>();
        anim = GetComponent<Animator>();
    }
 
    private void Update()
    {
        // Jump
        if (Input.GetButtonDown("Jump"&& !anim.GetBool("isJumping"))
        {
            rigid.AddForce(Vector2.up * jumpPower, ForceMode2D.Impulse);
            anim.SetBool("isJumping"true);
        }
 
 
        // Stop Speed
        if (Input.GetButtonUp("Horizontal")) 
        {
            rigid.velocity = new Vector2(rigid.velocity.normalized.x * 0.5f, rigid.velocity.y);
        }
        // Direction Sprite
        if (Input.GetButton("Horizontal"))
        {
            spriteRender.flipX = Input.GetAxisRaw("Horizontal"== -1;
        }
 
        // Running Animation
        if (Mathf.Abs(rigid.velocity.x) < 0.3)
        {
            anim.SetBool("isRunning"false);
        }
        else
        {
            anim.SetBool("isRunning"true);
        }
 
    }
 
 
    
    private void FixedUpdate()
    {
        //Move Speed
 
        float h = Input.GetAxis("Horizontal");
        rigid.AddForce(Vector2.right * h, ForceMode2D.Impulse);
 
        if (rigid.velocity.x > maxSpeed) // Right Max Speed
        {
            rigid.velocity = new Vector2(maxSpeed, rigid.velocity.y);
        }
        else if (rigid.velocity.x < maxSpeed * (-1)) // Left Max Speed 
        {
            rigid.velocity = new Vector2(maxSpeed * (-1), rigid.velocity.y);
        }
 
 
        // Landing Platform
        if (rigid.velocity.y < 0)
        {
            Debug.DrawRay(rigid.position, Vector3.down, new Color(010));
            RaycastHit2D rayHit = Physics2D.Raycast(rigid.position, Vector3.down, 1, LayerMask.GetMask("Platform"));
            if (rayHit.collider != null)
            {
                if (rayHit.distance < 1f)
                {
                    anim.SetBool("isJumping"false);
                }
            }
        }
        
 
    }
}
cs