#When using AlignPosition, how do you add a delay to the part that's following with LocalScripts?

1 messages · Page 1 of 1 (latest)

nocturne spear
#
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local char = player.Character or player.CharacterAdded:Wait()
local head = char:WaitForChild("Head")
local hatAttachment = head:WaitForChild("HatAttachment")

local customCamPart = Instance.new("Part") --Create the cam part
customCamPart.Name = "cam"
customCamPart.Size = Vector3.new(2, 2, 2) 
customCamPart.Position = head.Position --Set part position to the player head when created
customCamPart.CanCollide = false
customCamPart.Transparency = 0.5
customCamPart.Parent = game.Workspace

local attachment0 = Instance.new("Attachment") --Add attachment to the part
attachment0.Parent = customCamPart

local attachment1 = Instance.new("Attachment") --Add attachment to the head
attachment1.Position = hatAttachment.Position 
attachment1.Parent = head

local alignPos = Instance.new("AlignPosition")
alignPos.Attachment0 = attachment0
alignPos.Attachment1 = attachment1
alignPos.Parent = head
alignPos.ReactionForceEnabled = true


game.Workspace.CurrentCamera.CameraSubject = customCamPart --Set the part as camera

Just started learning how to code yesterday, Im trying to recreate Elden ring's camera movement (shown in the video), but I cant figure out how to add a slight delay when the character moves, when using a LocalScript the part seems to follow the head instantly

glossy rampart
#

could probably adjust the rigidity of the alignpos so that it doesnt immediately align

nocturne spear
rugged shell
nocturne spear
rugged shell
nocturne spear
rugged shell
nocturne spear
#

this is what happens when run in the server side

    local char = plr.Character or plr.CharacterAdded:Wait()
    
    local part = workspace:WaitForChild("Part")
    
    local plrAttach = Instance.new("Attachment")
    plrAttach.Position = char:WaitForChild("Head"):WaitForChild("HatAttachment").Position + Vector3.new(0,2,0)
    plrAttach.Parent = char.Head
    
    local partAttach = part:WaitForChild("Attachment")
    
    local alignPos = Instance.new("AlignPosition")
    alignPos.Attachment0 = partAttach
    alignPos.Attachment1 = plrAttach
    alignPos.Parent = char:WaitForChild("Head")
end)
forest quarryBOT
#

studio** You are now Level 1! **studio

rugged shell
#

Why would you want to run it server-side?

nocturne spear
rugged shell
glossy rampart
#

read up on the docs for alignposition

glossy rampart
glossy rampart