Jump to content

How do I set the player animations on IMountable?


Recommended Posts

I finally made my player interact and attach itself to a winged wolf. I plan to make it Mountable aswell. My problems are.

1. the player yaw is stuck facing at the wolf's back

        public float? MountYaw { 
            get{
                return HeadYaw = pilot.HeadYaw;
            }
        }

2. I cannot set an animation to the player, I would like to use the sit feature if you press G. I was ruminating if it is only set on a json file.
 


        public override void OnGameTick(float dt)
        {
            base.OnGameTick(dt);

            if(pilot != null) {
               IPlayer player = (pilot as EntityPlayer)?.Player;
               EntityAgent playerAgent = player.Entity;

               // set Animation to sitting
               if(player!= null) {
                 playerAgent.AnimManager.StartAnimation(this.SuggestedAnimation);
               }
            }

            if (!isOnGround())
            {
                this.isFlying = true;
                //cancel controlledphysics gravity
                this.isFlying = controls.IsFlying; 
            } 
        }

3. I plan to make an AI for it to be flyable.

Hopefully, code mods documents are easier to understand now.

2021-11-25_08-24-50.png

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.