View Single Post
kot4404
Senior Member
Join Date: Mar 2013
Old 02-17-2018 , 07:53   Re: SetParent that doesn't rotate prop?
Reply With Quote #8

Quote:
Originally Posted by Mitchell View Post
here is a stock I created awhile ago for parenting and using Attachements:
Code:
public void parentEntity(int child, int parent, const char[] attachment) {
    SetVariantString("!activator");
    AcceptEntityInput(child, "SetParent", parent, child, 0);
    if(!StrEqual(attachment, "", false)) {
        SetVariantString(attachment);
        AcceptEntityInput(child, "SetParentAttachment", child, child, 0);
    }
}
to parent to an entity use: parentEntity(child, parent, "");
to parent to an entity with a specific attachement point use: parentEntity(child, parent, "forward");
I managed to get the setparent working but I guess it wasn't what I wanted, it attaches the prop to bone but the prop is still rotating

I need to create grab command that attaches prop your looking at to your view + keep it at same distance from client all the time while maintaining the angle it had at the beginning
kot4404 is offline