using System.Collections;

using System.Collections.Generic;

using UnityEngine;


public class ShipManager : MonoBehaviour

{

    public float energy;

    public float force;

    public float weight;


    Animator anim;

    void Awake()

    {

        anim = GetComponent<Animator>();

    }



    void Update()

    {

        float speed = force / weight;

        if (Input.GetKey("up"))

        {

            anim.SetBool("OnBooster", true);

            transform.Translate(new Vector3(0, speed, 0));

            energy -= speed*Time.deltaTime;

        }

        else

        {

            anim.SetBool("OnBooster", false);

        }


    }

}



force=1 weight=10 으로 설정했는데 계속 speed가 Nan이라고 뜨면서 오류가 나네요 ㅜㅜ 구글링 아무리해봐도 Nan은 분모가 0인경우에만 뜬다고 되있는데 저는 도대체 왜그런거죠?