강의

멘토링

커뮤니티

Inflearn Community Q&A

tsg0702101957's profile image
tsg0702101957

asked

[MMORPG Game Development Series with C# and Unity] Part3: Unity Engine

Animation Blending

wait_run_ratio값이 0이하로 떨어져요

Written on

·

382

0

Animator anim = GetComponent<Animator>();
if (_movetodes)
{
wait_run_ratio = Mathf.Lerp(wait_run_ratio, 1, 7.0f * Time.deltaTime);
anim.SetFloat("wait_run_ratio", wait_run_ratio); anim.Play("WAIT_RUN");
}
else
{
wait_run_ratio = Mathf.Lerp(wait_run_ratio, 0, 7.0f * Time.deltaTime);
anim.SetFloat("wait_run_ratio", wait_run_ratio); anim.Play("WAIT_RUN");
}
Lerp를 써서 달릴때는 1로 가까워지는데 멈춰있을때는 0을 넘어서 음수가 되버리네요 ㅠㅠ 모션블렌드는 성공했는데 뭐때문에 이게 음수가 되버리는지 모르겠습니다
unityC#

Answer 2

1

Rookiss님의 프로필 이미지
Rookiss
Instructor

1.41e-45는 음수가 아니라 사실상 0이라고 보시면 됩니다.
1.41 * 10의-45승인데 이는 저어어어어엉말 깨알같이 작은 숫자입니다.

tsg0702101957님의 프로필 이미지
tsg0702101957
Questioner

아이고 ㅠㅠ 죄송합니다 -만 보고 음수인줄 알았네용 ㅠ

0

저도 이런 상황인데, 숫자가 계속 움직이다보니 좀 걱정됩니다. 뭐 데이터 같은거는 안 잡아먹겠죠? ㅠ 

tsg0702101957's profile image
tsg0702101957

asked

Ask a question