Hello everyone, i am making a system where a platform is aligned with the ground relevant to 4 points,
Enough of than, anyway i have 2 cframes, one that teleports the platform to another platform(lets call it pft2) and a second one that aligns the platform with the ground, the current issue is that i want the cframe that teleports the platform to “ptf2” to be instant and the one that aligns the platform with the ground to be lerped
Here is the code
local forward = board.Board.CFrame.LookVector
local right = forward:Cross(normal).Unit
local alignedForward = normal:Cross(right).Unit
local position = board.Board.Position
local alignedForward = alignedForward
local normal = normal
local targetNormal = Vector3.new(0, 1, 0)
local lerpedNormal = normal:Lerp(targetNormal, 0.05)
local targetCFrameWithLerpedNormal = CFrame.fromMatrix(position, alignedForward, lerpedNormal) * CFrame.new(0, -0.5, 0)
local interpolatedRotationCFrame = part.CFrame:Lerp(targetCFrameWithLerpedNormal, 0.05)
part.CFrame = CFrame.new(position) * CFrame.new(0, -0.5, 0)
part.CFrame = interpolatedRotationCFrame
The current version is my attempt at solving it, but it doesnt work, ive spent way too much time on this than i’d like to admit
Heres the effect in game(as you can see the skateboard is aligning with the ground but its trailing behind) Skip to 16 sec to see it