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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.