Help setting tool grip in front of character head

Hi, I am currently working on a gun system and I want to make that when you right click (aim) the gun moves in front oh the player’s head using tool.GripPos. The issue is that instead of moving the gun in front of the head it moves in a wrong position or far away. I tried almost everything I found on the internet but i didn’t solve the problem. This is the piece of code controlling the movement, thanks.

local NewGripPos = Vector3.new(Head.Position.X, Head.Position.Y + YOffset, Head.Position.Z + ZOffset)
Tool.GripPos = Character.Head.CFrame:PointToObjectSpace(NewGripPos)
1 Like

The Grip Position is set by Offset so you would have to do its as an offset from the hand the tools held from.

1 Like

Also your setting .GripPos which isn’t a property of a Tool instance, instead use .Grip

1 Like

image_2024-07-23_105841098

setting The Grip to Vector3.new(1.5,-1,-1) pivots the tool to the FaceFrontAttachment in the head of a humanoid.

1 Like

When I use Tool.Grip I get an error saying “CoordinateFrame expected, got Vector3”, but if I use CFrame it doesn’t modify the position at all but the rotation instead

1 Like

Try Grip.Position if your not looking for the orientation to be pivoted differently.

1 Like

something like this:

workspace.Tool.Grip.Position = Vector3.new(1.5,-1,-1)
1 Like

The console says “Position cannot be assigned to”

1 Like

Interesting, try setting the CFrame in that case. Like this:

local pivotOffset = Vector3.new(1.5,-1,-1)

Tool.Grip = CFrame.new(pivotOffset)
1 Like

I tried, this is the result
Screenshot_1

1 Like

Show me what it looks like without modifying the Grip.

1 Like

1 Like

Any news or solutions,? I haven’t figured it out yet

1 Like

Oh I thought you fixed it. Is this not what your looking for?