Jump to content
This Topic

Recommended Posts

Posted

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

Posted

Think so, you need to make sure all the parents have the 'Dynamic' shadow set for it to check. Shadows will stop at a 'None' child and not check any of it's children after that.

  • Upvote 1
trindieprod.png?dl=0spacer.png?dl=0steam-icon.png?dl=0twitter-icon.png?dl=0spacer.png?dl=0

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.

×
×
  • Create New...