인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

fruits976135's profile image
fruits976135

asked

Unity Game Development (Unity 2D) - From Start to Deployment

Parameter Change

HP가 50보다 크면 넘어가게했는데 50보다 작아도 shoot으로 넘어가지네요

Written on

·

176

0

GetComponent().SetTrigger("Shoot_t");

float temp = GetComponent().GetFloat("HP_f");

GetComponent().SetFloat("HP_f", temp-10);

이렇게 해서 -10씩 줄어드는건 잘되는데 50아래로 내려가도 shoot으로 넘어가지는데 왜그런지 알 수 있을까요?

unity

Answer 2

0

설정한 조건을 하나라도 만족하면 넘어 가는 것 같습니다.

조건 방식을 OR 가 아닌 AND로 설정할 순 없나요?

0

agl05250070님의 프로필 이미지
agl05250070
Instructor

음 해당 애니메이터의 파라미터에 HP_f가 50보다 같거나 클때만 넘어가도록 조건을 설정해주시면 됩니다.

fruits976135's profile image
fruits976135

asked

Ask a question