(В Unity) По какой-то причине мой компонент-аниматор мешает коду, используемому для переворота персонажа, и не обновляет ⇐ C#
(В Unity) По какой-то причине мой компонент-аниматор мешает коду, используемому для переворота персонажа, и не обновляет
I tried to call the function below to flip my character game object, and it works just fine, but only if the animator component is disabled. For some reason if the animations run the transform will not change. I've been looking for hours for other solutions but nothing has worked.
void Flip() { facingRight = !facingRight; Vector3 Scaler = transform.localScale; Scaler.x *= -1; transform.localScale = Scaler; } Even if I manually change the transform rotation x while the animator is enabled, the character still won't flip.
I've tried moving my code to different locations (update, fixed update, late update, etc.,) as well as the code for the animation transitions, but that changed nothing. I've also tried other similar scripts I saw recommended, but so far nothing's worked. I feel like maybe I'm just missing something obvious since I'm a complete beginner, but I just can't figure out what.
Источник: https://stackoverflow.com/questions/781 ... he-code-us
I tried to call the function below to flip my character game object, and it works just fine, but only if the animator component is disabled. For some reason if the animations run the transform will not change. I've been looking for hours for other solutions but nothing has worked.
void Flip() { facingRight = !facingRight; Vector3 Scaler = transform.localScale; Scaler.x *= -1; transform.localScale = Scaler; } Even if I manually change the transform rotation x while the animator is enabled, the character still won't flip.
I've tried moving my code to different locations (update, fixed update, late update, etc.,) as well as the code for the animation transitions, but that changed nothing. I've also tried other similar scripts I saw recommended, but so far nothing's worked. I feel like maybe I'm just missing something obvious since I'm a complete beginner, but I just can't figure out what.
Источник: https://stackoverflow.com/questions/781 ... he-code-us
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Можете ли вы использовать CSS для зеркального отображения/переворота текста?
Anonymous » » в форуме Html - 0 Ответы
- 17 Просмотры
-
Последнее сообщение Anonymous
-