# ゲーム実行中、live2dモデルの表示/非表示を行った際に半目の状態になってしまう問題を解決したい

**URL:** <https://creatorsforum.live2d.com/t/topic/2196>\
**Category:** 制作の質問やTips紹介\
**Created:** [2023 年 12 月 14 日午後 1:35 UTC](https://creatorsforum.live2d.com/t/topic/2196 "2023-12-14T13:35:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![onlysomething7](https://sea1.discourse-cdn.com/flex015/user_avatar/creatorsforum.live2d.com/onlysomething7/32/1874_2.png) [@onlysomething7](https://creatorsforum.live2d.com/u/onlysomething7)\
**Post date:** [2023 年 12 月 14 日午後 1:35 UTC](https://creatorsforum.live2d.com/t/topic/2196/1 "2023-12-14T13:35:10Z")

</div>

[os win11]  
[CubismSdkForUnity-4-r.7]  
[Unity 2022.3.14f1]

お世話になっております。

unityにインポートしたモデルをゲーム実行中に同一シーン内で表示/非表示を行った際、タイミングによってまばたきが半目のままぴくついてしまいます。

モデル自体のモーションはAnimatorで制御し、そこにCubismAutoEyeBlinkInputをアタッチして自動でまばたきをさせているのですが、対処法等お教えいただければ幸いです。

---

<div class="post-metadata">

**Author:** ![ono-at-live2d-com](https://sea1.discourse-cdn.com/flex015/user_avatar/creatorsforum.live2d.com/ono-at-live2d-com/32/167_2.png) [@ono-at-live2d-com](https://creatorsforum.live2d.com/u/ono-at-live2d-com)\
**Post date:** [2023 年 12 月 20 日午前 9:00 UTC](https://creatorsforum.live2d.com/t/topic/2196/2 "2023-12-20T09:00:27Z")

</div>

@onlysomething7 様

いつも弊社製品をご愛顧くださり誠にありがとうございます。  
Live2Dスタッフでございます。

Cubism SDK for Unityは、メッシュの更新と描画を非同期で処理できるよう、各アートメッシュごとに２つのMeshを持っています。  
表示状態を切り替えた際、目の開閉用パラメータの値を初期化し、両方のメッシュに対して更新する必要があります。

以下はOnEnable()のタイミングで値をリセットする処理のスニペットになります。

```auto
// 目の開閉用パラメータの値をリセットする処理
...

// 現在のパラメータの値を記録
ParameterStore.SaveParameters();

// 頂点の更新を２つあるメッシュ両方に適用
CubismModel.ForceUpdateNow();
CubismModel.ForceUpdateNow();

// 更新したメッシュをレンダラーとマスクに反映
RenderController.OnLateUpdate();
MaskController.OnLateUpdate();

```

よろしくお願いいたします。
