Hi there
I’m trying to make a prop system and I’m having some trouble getting the prop to go to an offset off of the camera’s CFrame and also moving it smoothly to that point after picking it up. I currently have this as the function which offsets the prop from the camera’s CFrame. It’s in a modulescript called by a serverscript.
function PropService.PropHeld(Prop)
local CameraCFrame = Camera:GetRenderCFrame()
local RequiredPropPosition = CameraCFrame * CFrame.new(0, 0, -5)
Prop.CFrame = Prop.CFrame:Lerp(RequiredPropPosition, TweenService:GetValue(0, Enum.EasingStyle.Cubic, Enum.EasingDirection.InOut))
end
end)
end)
(this function is then called using Heartbeat in the ServerScript so that it updates every frame)
The problem here is that the prop doesnt move at all.
Things I’m trying to achieve with this (just so you know)
- Smooth movement at a specific offset from the camera
- Smooth movement to this offset (not instant teleportation)
- Works within my current setup (serverscript parented to the prop calls functions within a modulescript which do everything to minimise repeated code - i don’t want everything within the serverscript as that would mean that each prop requires a lengthy script which is inefficient)
Any help is appreciated
Thanks