SeedV / SeedUnityVRKit

A toolkit using Mediapipe to run motion tracking in Unity. Support desktop, Android and iOS.
Apache License 2.0
19 stars 3 forks source link

NullReferenceException #55

Open Zumbalamambo opened 2 years ago

Zumbalamambo commented 2 years ago

thank you for the great example.

It throws the following exception while trying to run the code,

NullReferenceException: Object reference not set to an instance of an object
SeedUnityVRKit.UpperBodyAnimator.Start () (at Assets/Src/Scripts/Animator/UpperBodyAnimator.cs:54)

how do I fix this?

Zumbalamambo commented 2 years ago

and does it not animate also the legs?

henryouly commented 2 years ago

The code expects a game object called MTH_DEF in the scene tree. (LIkewise, it also expects EYE_DEF and EL_DEF in the next few lines of code.)

The VTuber scene in this project should demonstrate how it looks like.

Do you replace the model with your own? If so it may not work, and you will need to look at what name in your model that represent the mouth / eye / eye lip and replace the name in the code.

henryouly commented 2 years ago

The UpperBodyAnimator doesn't animate legs. It focuses on the facial expression, hands and arms. If you need the leg movement, you can check ModelAnimator.

superkudo commented 2 years ago

You can subclass the UpperBodyAnimator and customize your model specialpart initialization in function GetSpecialPart()