Animatorを再有効化すると初期化される

Unityでanimatorを無効化し、再度有効化するとパラメーターや遷移状態がリセットされてしまう。

gameobjectを非アクティブ状態からアクティブ状態にしても同じくリセットされる。

 

unity2018.1~から状態を維持できるようになっている。

Animator.keepAnimatorControllerStateOnDisable = true;

これをスクリプト側で記述するか

 

InspectorのデバッグモードしてココのチェックをつければOK

 

 

これ知らなくてまぁハマりましたね・・・

 

参考

https://docs.unity3d.com/ja/2018.4/ScriptReference/Animator-keepAnimatorControllerStateOnDisable.html

 

 

 

追記


デバッグモードはココから

Debugを選択

関連記事


Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 44

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 45

Warning: Trying to access array offset on false in /home/sirohood/sirohood.exp.jp/public_html/wp-content/themes/oria/single.php on line 46



Animatorを再有効化すると初期化される” への2件のフィードバック

  1. InspectorのデバッグモードしてココのチェックをつければOK
    とありましたが、そのデバッグモードのやり方を教えてください。Unity画面のどこを押せば出てくるのでしょうか?


コメントを残す

※コメントは承認後に表示されます。
 コメントを公開されたくない場合、名前の後に「:非公開」とつけてください。