Jump to content

Shadow of child entity


Recommended Posts

I have a character with hand bone (name "right hand") and a gun

 

npc.model = Model:Load("character.mdl")

npc.hand = npc.model:FindChild("right hand")

npc.weapon = Model:Load("weapon.mdl")

npc.model:SetShadowMode(2)

npc.weapon:SetShadowMode(2)

 

There is a direction light can cast shadow on entities. If I use: npc.weapon:SetParent(npc.hand)

then the shadow of the weapon disappears on the ground but shadow of character.

If I don't use SetParent(npc.hand) for npc.weapon, both of shadow appear

 

I tried npc.hand:SetShadowMode(2) combine with npc.weapon:SetParent(npc,hand) but weapon's shadow still disappear.

 

How can I make weapon's shadow appear when it has parent entity ? smile.png

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.
Note: Your post will require moderator approval before it will be visible.

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