2016-05-16 26 views
-1

我有統一的動畫,基本上它顯示特朗普運行:我的動畫比較滯後,爲什麼?

enter image description here

我也有王牌跳躍的這一個幀動畫:

enter image description here

基本上,當他跳躍,跳躍動畫播放,當他着陸時,步行動畫再次播放。

enter image description here

這一切工作,並運行此代碼是:

function Update() { 
    trump.velocity = Vector2(speed, trump.velocity.y); 
    if (jump > 0) { 
     jumpBool = true; 
    } 
    else { 
     jumpBool = false; 
    } 
    animator.SetBool("Jump", jumpBool); 

這是在物理學腳本。然後,從動畫師:

enter image description here enter image description here

這一切工作,和動畫的時候都應該改變。問題在於,它在完成之前滯後。我認爲當特朗普跳躍時,步行動畫在切換到跳躍動畫之前完成。我的問題是,我該如何自動切換動畫,所以它看起來不那麼遲鈍?

回答

1

您可以立即調用跳轉動畫,使其在您創建JumpBool = true時播放。這樣做不需要等待漫遊動畫完成,它只會停止漫遊,然後移動到跳轉。

​​

enter image description here

你甚至都不需要設置布爾,後跳動畫結束將移回城動畫。

enter image description here