I’m making a part that moves in the direction in which a player is facing. I pass the lookvector from the client through a remoteevent and to be received by the server. The issue is, the entire thing doesn’t update. I tried some printing stuff, and that works, when I print the lookvector on the client it works. But not with the server, the server only prints two values, and they never update even when I move my camera and fire the remoteevent. I would appreciate any help you guys could provide. Thanks in advance.
LocalScript
local Players = game:GetService("Players")
local runtime = game:GetService("RunService")
runtime.Stepped:Connect(function(deltaTime)
local localPlayer = Players.LocalPlayer
local camera = workspace.CurrentCamera
local character = localPlayer.Character:WaitForChild("Humanoid")
local lookvector = camera.CFrame.LookVector
local input = game:GetService("UserInputService")
local ebutton = Enum.KeyCode.E
input.InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == ebutton then
local remotedetonator = game.ReplicatedStorage.RemoteEvent
remotedetonator:FireServer(lookvector)
end
end)
end)```
Server side
```lua
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remotedetonator = game.ReplicatedStorage.RemoteEvent
remotedetonator.OnServerEvent:Connect(function(localPlayer, lookvector)
local Part = workspace.Part
local linearvelocity = Instance.new("LinearVelocity")
local At0 = Instance.new("Attachment")
print(lookvector)
Part.Anchored = false
At0.Parent = Part
linearvelocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Line
linearvelocity.LineVelocity = 10
linearvelocity.LineDirection = lookvector
linearvelocity.Parent = Part
linearvelocity.MaxForce = math.huge
linearvelocity.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
linearvelocity.Enabled = true
linearvelocity.Attachment0 = At0
end)```