-
What do I want to achieve?
I want to Lerp the rotation of the handle to face the character’s head, while keeping the position of the handle at its respective trigger part, with no lerping (see script snippet at bottom). This way, the position would change instantly, but the orientation to face the character’s head would lerp smoothly. I don’t need easing, just default lerp is fine. -
What is the issue?
It doesn’t seem possible to lerp only the rotaton to “look at” while keeping the position changing constant. -
What solutions have I tried so far?
- Looking on the dev forum
- a bunch more stuff I can’t remember the details of
this next script lerps the position and the orientation. I just want to lerp the orientation to look at the character’s head:
local function Grab(Hand)
BackpackAccessory.Parent = script
GrabbedBackpackModel = ReplicatedStorage.BackpackContent.GrabbedBackpack:Clone()
GrabbedBackpackModel.Parent = game.Workspace
local Handle = GrabbedBackpackModel.Handle
if Hand == "Right" then
GrabConnection = RunService.RenderStepped:Connect(function()
Handle.CFrame = Handle.CFrame:Lerp(CFrame.new(RightHandTriggerPart.Position, Head.Position) * CFrame.Angles(0, math.rad(90), 0), 0.1)
end)
elseif Hand == "Left" then
GrabConnection = RunService.RenderStepped:Connect(function()
Handle.CFrame = Handle.CFrame:Lerp(CFrame.new(LeftHandTriggerPart.Position, Head.Position) * CFrame.Angles(0, math.rad(90), 0), 0.1)
end)
end
end