Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can't find how to move correctly the CFrame position for my framework where am I wrong in my code?

Asked by
Volt3Z 40
7 years ago

So i am making a framework (fps) using Inverse Kinematics but in my script when i want to move the hand to a position it never the same position depending on where i am in the space of the world(Location of the player) and I can't find how to solve this problem plz help me.

this is the part of the code that moves the hands.

game:GetService("UserInputService").InputBegan:connect(function(input)
    if input.KeyCode == Enum.KeyCode.H then
    model.RightHand.CFrame = model.RightHand.CFrame:lerp(CFrame.new(model.ArmsPresets.Inspect.R1.Position)* CFrame.Angles(0, 180, 0),.1)
    wait(1)
    model.RightHand.CFrame = model.RightHand.CFrame:lerp(CFrame.new(model.ArmsPresets.Inspect.R2.Position)* CFrame.Angles(0, 180, 0),.1)


    end
end)

if you have any question on how my script works just comment and i will answer.

0
You are going to have to find it relative to your character's position. I think you would bring your lookVector into this. Arystov 45 — 7y

Answer this question