RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"A lerping system for a viewmodel"
Here's a simple lerping system for a viewmodel in Roblox. This script should be placed in a LocalScript. ```lua local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local viewModel = character:WaitForChild("ViewModel") local targetPart = character:WaitForChild("TargetPart") local lerpSpeed = 0.1 while true do local newPosition = targetPart.CFrame * CFrame.new(0, 0, -5) -- Adjust the offset as needed viewModel.CFrame = viewModel.CFrame:Lerp(newPosition, lerpSpeed) wait() end ``` This script assumes that there is a "ViewModel" part inside the player's character and a "TargetPart" part that the viewmodel should follow. The script lerps the viewmodel's position to the target position with a specified speed. You can adjust the lerpSpeed variable to change how fast the viewmodel moves.