.. _FeatureCreation: ================== Creating a feature ================== To create an avatar feature, you need to create a class that inherits from AvatarFeature A Feature must have the following attributes: - AvatarReadyName to define the name of the feature for the avatar ready inspector - AvatarReadySupportedProvider to define the providers that support this feature One or many AvatarReadyConstOption / AvatarReadyObjectOptionAttribute / AvatarReadyReflectionOptionAttribute to add parameters to the feature that can be edited in the avatar ready inspector. .. code-block:: c# :caption: Example of attributes for the Hide Avatar If IK Mismatch Feature [AvatarReadyName("Hide Avatar if IK Mismatch", "Hide the body of the avatar when there is a mismatch between user's position and avatar's position, eg. when teleporting")] [AvatarReadySupportedProvider(typeof(AvatarProvider), false)] [AvatarReadySupportedSystem(typeof(IKAnimationSystem))] [AvatarReadyConstOption(0, "Tolerance Distance", "toleranceDistance", typeof(float), 0.25f)] public class HideAvatarIfIKMismatchFeature : AvatarFeature { ... } Features can implement two functions inherited from AvatarFeature, InitFeature and ResetFeature if some setup and clean up are needed for the feature .. code-block:: c# public abstract class AvatarFeature : MonoBehaviour { public virtual void InitFeature(AvatarReady avatar = null) { } public virtual void ResetFeature() { } } A feature is a Unity Component (MonoBehaviour) that is added to the avatar.