I need help. I’ve been wrestling with this for several days. I really want to love MARS - the thinking that’s gone into it is amazing and it seems like a powerful tool. However, getting it to do anything beyond the basics using scripting is proving difficult using the current documentation.
Note: I paid the $600 for the product, and still can’t get off of the ground.
Here’s my question: I want to extract the HumanPose data on every MARS session update. My goal is to apply that data to a secondary human avatar. The workflow is: pull HumanPose from the MARS detected human, then apply that data to an NPC human avatar.
I’ve implemented the Action interface, then attached the script to the body Proxy, as described in the documentation. However, I can’t seem to read the data from the queryResult. I’ve tried the TryGetTrait route, but its data always reports null (when running from the simulator). I’ve also tried queryResult.ResolveValue, but that throws an exception:
NullReferenceException: Object reference not set to an instance of an object
Unity.MARS.Data.IUsesMARSTrackableDataGenericMethods.GetIdValue[T] (Unity.MARS.Data.IUsesMARSTrackableData1[T] obj, System.Int32 dataId) (at Library/PackageCache/com.unity.mars@1.4.1/Interfaces/Subscribers/IUsesMARSTrackableData.cs:50) Unity.MARS.Query.QueryResult.ResolveValue[T] (Unity.MARS.Data.IUsesMARSTrackableData1[T] dataUser) (at Library/PackageCache/com.unity.mars@1.4.1/Runtime/Scripts/Backend/Queries/QueryResult.cs:57)
I’ve attached an example script.
PLEASE HELP!!!
7915732–1009852–TestBodyDataAction.cs (1.22 KB)