LinearVelocity.LineDirection not updating

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)```

please send your server script which receives the values as well so we can see what your issue is.

It’s already fixed, the solution was that I used linedirection, which has a very strange way of working. If you instead use linearvelocity.vectorvelocity and then set it to whatever value, (should be in Vector3.new form, and preferably the X, Y, and Z should be equal), and then multiply it with the lookvector.

As for the printing part… I actually don’t remember because I deleted the code…

Sorry everyone.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.