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!