//ここからGoogleタグのコード //以上でGoogleタグのコード終了

UnityでVRChatアップ時のエラーゲーム オブジェクトにアタッチされた「アニメーター」はありませんの対処法

 

ここの記事の内容

UnityでVRChat用のモデルをアップロードしようとしてもできない時のエラーの一つの対処方法を書いています。
エラー本文とそれのGoogle翻訳、要約、対処法を書いています。

記事執筆日時
2022年9月5日
Unityバージョン2019.4.3
VRChatSDK3

 

エラー本文

Unityのコンソールを見る、エラーの表示を1回クリック、Ctrl+Cでエラー内容をコピー(この時はUnityは無反応)、あとはGoogle翻訳などでCtrl+Vでペーストしたら見れます。

 

MissingComponentException: There is no 'Animator’ attached to the “UV展開12-905B" game object, but a script is trying to access it.
You probably need to add a Animator to the game object “UV展開12-905B". Or your script needs to check if the component is attached before using it.
VRC.SDKBase.Editor.VRCSdkControlPanelAvatarBuilder.OnGUIAvatarCheck (VRC.SDKBase.VRC_AvatarDescriptor avatar) (at Assets/VRCSDK/Dependencies/VRChat/Editor/ControlPanel/VRCSdkControlPanelAvatarBuilder.cs:329)
VRC.SDKBase.Editor.VRCSdkControlPanelAvatarBuilder.ShowBuilder () (at Assets/VRCSDK/Dependencies/VRChat/Editor/ControlPanel/VRCSdkControlPanelAvatarBuilder.cs:94)
VRCSdkControlPanel.ShowBuilders () (at Assets/VRCSDK/Dependencies/VRChat/Editor/ControlPanel/VRCSdkControlPanelBuilder.cs:329)
VRCSdkControlPanel.OnGUI () (at Assets/VRCSDK/Dependencies/VRChat/Editor/ControlPanel/VRCSdkControlPanel.cs:214)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at <a259d3c004024353a2c217da97495055>:0)
UnityEditor.HostView.Invoke (System.String methodName) (at <a259d3c004024353a2c217da97495055>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <a259d3c004024353a2c217da97495055>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <a259d3c004024353a2c217da97495055>:0)
UnityEditor.DockArea.OldOnGUI () (at <a259d3c004024353a2c217da97495055>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.IMGUIContainer.DoIMGUIRepaint () (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.UIR.RenderChainCommand.ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams drawParams, System.Boolean straightY, System.Single pixelsPerPoint, System.Exception& immediateException) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
Rethrow as ImmediateModeException
UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.UIElements.PanelClearFlags clearFlags) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.Panel.UpdateForRepaint () (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <b6a7e1825c0b45d3b0729282e86cc687>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <344226e341014466b33f0c0fa34fcef5>:0)

※UV展開12-905Bは筆者のゲームオブジェクト名です。

Google翻訳

MissingComponentException: 「UV展開12-905B」ゲーム オブジェクトにアタッチされた「アニメーター」はありませんが、スクリプトがそれにアクセスしようとしています。
おそらくゲームオブジェクト「UV展開12-905B」にアニメーターを追加する必要があります。または、コンポーネントを使用する前に、コンポーネントがアタッチされているかどうかをスクリプトで確認する必要があります。

 

原因の説明(要約)

UV展開12-905B(ゲームオブジェクトの名前)のスクリプトがアニメーターにアクセスしようとしてるけどアニメーターのスクリプトが無いよ
スクリプトを確認して追加してね

対処

ゲームオブジェクトをヒエラルキーで選択した後、インスペクターを見ます。
スクリプトの一覧にAnimatorが無いことを確認して下さい。
有ってもエラーが出る場合は削除してもう一度追加してみましょう。

 

Animatorのスクリプトの追加
コンポーネントの追加→animと検索をかけてAnimatorのスクリプトを追加します。


Animatorのスクリプトの設定
コントローラーのなし(Runtime Animator Controller)をvrc_AvatorV3HandsLayerに変更。
下の画像①の+をクリック
②のvrc_AvatorV3HandsLayerを選択

画像は見やすくするためにUnityの配置を変更しています。
②の項目は左上の方に出ると思います。


アバターの設定
次にAnimatorの中のアバターの右の+をクリック、ゲームオブジェクト名を選んで下さい。

※UV展開12-905Bは筆者の使っているゲームオブジェクト名でここは各個人で違います。

 

これが済んだらVRChatSDKを起動したあと、Unityのコンソールを見て同じエラーが無いかチェックして下さい。
同じエラーが出なければ修正完了です。
おつかれさまでした。

 

Animatorのスクリプトが消える原因

突然消える、としか言えません。
同じ作業をしてても消える時、消えない時があるようです。

 

以上でこの記事は終わりです。
最後までお付き合いいただきありがとうございました。