Jump to content

Recommended Posts

Posted (edited)

Hello! I need help - I've got an living entity with a held item. The item is rendered using layer in render class. The problem is the item is not connected with hand - it stays in place all the time, even if the hand is moving. How can I implement feature of connecting held item with hand?

Edited by Krevik
Posted
  On 11/11/2018 at 5:32 PM, Krevik said:

The item is rendered using layer in render class.

Expand  

Are you using a custom layer for that or a vanilla one? If it's a custom layer you need to show it's implementation to us.

If you are using a vanilla one is the model of your entity an instance of BodelBiped? And if it is are you overriding ModelBiped#postRenderArm?

Posted (edited)

Render File:
 

  Reveal hidden contents

RenderLayerDeathScythe

  Reveal hidden contents

ModelDeath

  Reveal hidden contents

also github with the code: Link

  On 11/12/2018 at 12:02 AM, V0idWa1k3r said:

Are you using a custom layer for that or a vanilla one? If it's a custom layer you need to show it's implementation to us.

If you are using a vanilla one is the model of your entity an instance of BodelBiped? And if it is are you overriding ModelBiped#postRenderArm?

Expand  

Layer is copied from vanilla, just changed scaling and added some translation

Edited by Krevik
Posted

You are returning the wrong arms in ModelDeath#getArmForSide. You return either LeftArm2 or RightArm2 and those are never rotated. Their parents may be, but they aren't. ModelRenderer#postRender changes the matrix according to it's rotation, not the rotation of it's parents.

  • Like 1
Posted
  On 11/12/2018 at 7:29 AM, V0idWa1k3r said:

You are returning the wrong arms in ModelDeath#getArmForSide. You return either LeftArm2 or RightArm2 and those are never rotated. Their parents may be, but they aren't. ModelRenderer#postRender changes the matrix according to it's rotation, not the rotation of it's parents.

Expand  

YEAH You're right, Thanks!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.