How would I go about pointing something with a local axis at something with a global position

So I have been trying to create a tool that aims at a global point(when clicked). However, the big problem is the tool. You see the tool’s entire axis is RELATIVE to the player, more specifically (I believe) relative to the RightGripAttachment (within Right Arm),the Right Arm, or the HumanoidRootPart.
Given that we know where the position is that we would like to point at (for the sake of this example, we will call this global point “End_Point”) and we assume that the orientation of the part is relative to the rotation of either the right arm or humanoidrootpart(your choice), how could we make the red part shown below always point at the green part, no matter if the player turns around?
image

You need to perform any calculations in the same vector space (a CFrame). Since your pointer is attached to the character, you should do them in that space. Transform the End_point into the space of the arm. You can use armCFrame:PointToObjectSpace(End_Point) to do this.

Okay I did some programming like this and got this result, so how would I go about fixing how it is rotating the wrong direction (it ends up pointing slightly to the left of the block), or am I making mistake by using lookAt?

local pointingPart = script.Parent.PointPart
local endPoint = script.Parent.End_Point
local originalPos = pointingPart.Position
local relPosition = pointingPart.CFrame:PointToObjectSpace(endPoint.Position)
pointingPart.CFrame = CFrame.lookAt(endPoint.Position,relPosition)
pointingPart.Position = originalPos

image

You need to use a CFrame other than the one you’re setting otherwise there will be feedback, such as the CFrame of the arm.

What is the pointing part attached to? Is it welded or constrained to the right arm?

The pointing part is whatever happens to a tool’s “handle” part, so I honestly dunno. Edit: It is welded.