Problems with aligning a weapon?

I have a weapon that Im trying to allign using gripforward,grippos,gripright,etc, but its becoming difficult to get it to align properly.

if for example I change forward grip to vector3.new(0,0,-0.5), it instead changes to (1,0,-0.545) or any other random vector3. why is it doing this and how can I use these properties the right way?

Can you show us an example of what you are trying to accomplish please?

You should use this plugin! Simplifies tool grip editing

Annotation 2020-01-28 170913

normally equipping a tool just rotates one arm and the tool is already aligned with the hand. however I added an animation that rotates both arms which caused the weapon to align with the hand, but not in the right way. I was trying to change the properties of the tool to have the gun point straight forward when the issue mentioned above occured.

1 Like

The GripForward, GripRight, and GripUp properties are the rotational components of the tool’s Grip CFrame, so when you manually change one the others have to adjust to ensure the vectors are orthogonal. It might be a better idea to rotate the tool by setting the Grip property instead of its components.

I see there’s no “grip” property in the tool, but I can print “tool.Grip” and it looks like it prints all of the other grip properties. could you show me how I would set the grip to accomplish my goal?

by default a tool’s grip is the identity CFrame with the properties:

  • position: 0, 0, 0
  • forward: 0, 0, -1
  • up: 0, 1, 0
  • right: 1, 0, 0

If you need to rotate the weapon around it’s Y axis you can set it’s CFrame in the command bar line:

local pos= = Vector3.new(0, 0, 0) -- tinker with this if you need to offset it's position
local rot = 5 -- rotation offset
(tool).Grip = CFrame.new(pos) * CFrame.Angles(0, math.rad(rot), 0)
-- returns the identity CFrame offset by (pos) and rotated by (rot) degrees
2 Likes

that seems to have done it, thanks.