News Forums RAIN General Discussion and Troubleshooting FieldSerializer Issue

This topic contains 0 replies, has 1 voice, and was last updated by  MeTheOo 3 weeks, 1 day ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #40505

    MeTheOo
    Participant

    RAIN version: RAIN 2.1.11.0
    I got the following warning sometimes:

    FieldSerializer: Couldn’t deserialize type: System.Type (ShipMotorController)

    My custom motor class below:

    using RAIN.Action;
    using RAIN.Core;
    using UnityEngine;
    using RAIN.Serialization;
    // Need to serialize otherwise the values in editor will be reset
    [RAINSerializableClass]
    public class ShipMotorController : RAIN.Motion.BasicMotor
    {
      public override void UpdateMotionTransforms()
      {
        // Only consider position
        AI.Kinematic.Position = AI.Body.transform.position;
        AI.Kinematic.ResetVelocities();
      }
      public override void ApplyMotionTransforms()
      {
        // Only consider position
        AI.Kinematic.UpdateTransformData(AI.DeltaTime);
        AI.Body.transform.position = AI.Kinematic.Position;
      }
    }

    Before:
    https://www.dropbox.com/s/bmnqj20jep26p9x/ShipMotorController.png?dl=0

    After:
    https://www.dropbox.com/s/47l5ffe8ykpqh64/BasicMotor.png?dl=0

    When the warning happens, the prefab with RAIN AI Rig script attached and had ShipMotorController selected will be reset to basic motor.

    Please advise.

    Thanks!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.