Hey everyone, so I’m implementing an aiming system for my fps framework, and you the lerping between the aiming cframe and the idle cframe isn’t working as intended.
Here’s my code (ripped from the rest of the script):
local equipOffset = self.settings[self.curwep].cframes.idle.start:lerp(self.settings[self.curwep].cframes.idle.finish, self.lerpValues.equip.Value)
finalOffset *= equipOffset
...
finalOffset = finalOffset:lerp(self.settings[self.curwep].cframes.aim.cframe, self.lerpValues.aim.Value)
Here, I’m using the same CFrame for both the idle cframe and the aiming cframe (check my settings module below, mainly for cframes.idle.start and cframes.aim.cframe):
module.cframes = {
idle = {start=CFrame.new(0, -0.23, 0) * CFrame.Angles(0, math.rad(30), math.rad(30)), finish=CFrame.new(.08, -.13, .26), speed=0.9, damping=0.8},
aim = {cframe=CFrame.new(.08, -.13, .26), speed = 1.8, damping=.8, shove=Vector3.new(.5, .3, 0)},
sprint = {cframe=CFrame.new(2.5, -.2, -1.4) * CFrame.Angles(0, math.rad(60), math.rad(30)), speed = 2, damping=1}
}
However, when I try aiming, the gun just flies off the screen for whatever reason. Here’s a video showing the issue:
Not sure what I’m doing wrong here, so any help is appreciated!