(В Unity) По какой-то причине мой компонент-аниматор мешает коду, используемому для переворота персонажа, и не обновляетC#

Место общения программистов C#
Ответить
Anonymous
 (В Unity) По какой-то причине мой компонент-аниматор мешает коду, используемому для переворота персонажа, и не обновляет

Сообщение Anonymous »


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
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»