Catdaemon posted:
Get the shootpos, stick it there and then parent it to the gun without setting any attachments.
Setting something to the shootpos sticks the ent in the players head or something.
Edit:
SteveUK posted:
In the Source SDK SetParent() has an additional parameter for the attachment, I don't know if it's in the Lua implementation.
Edit: talked to Garry on Gtalk, apparently this isn't avaliable yet, and has added it to the next release.
This would be pretty nice.
Edit:
Catdaemon posted:
You can do it through ent:Fire.
entity:Fire("setparentattachment","eyes",0)
Hmm... this seems to work better than anything else that I have tried. It still behaves a bit oddly, but not as oddly as before.
Edit: That is the first-person view is weird -- the entity swings way over to the right or left when I turn that direction, and bounces a lot when I move. Looks great from third-person though I think
Screenshots of the latest code using setparentattachment.