BMWLux
(BMWLux)
November 2, 2022, 3:22am
#1
Hi, I created a client side script that moves a character, but it is client sided. It does move the character server sided as expected
Client Sided
Server Sided
All the movement script is in a client sided script, and it is obviously effecting the server sided. I’m cerious why they are offset and how I can allign them? Thanks - lux
DataSigh
(DataSigh)
November 2, 2022, 3:36am
#2
Why are you creating a custom system instead of using robloxs default? It’s also a client authoritative movement system
BMWLux
(BMWLux)
November 2, 2022, 3:38am
#3
I’m creating a cannon you can fire yourself out of, by movement I mean putting velocity into the characters humanoid root part.
BMWLux
(BMWLux)
November 2, 2022, 3:39am
#4
You can aim the cannon so therefore you need it to be handled on the client. I am using a module made by “EgoMoose” and it relies on a client sided script as well.
BMWLux
(BMWLux)
November 2, 2022, 3:43am
#6
Client
local SPEED = 200
local BALL = game.ReplicatedStorage:WaitForChild("Ball")
local mouse = require(game.ReplicatedStorage:WaitForChild("Mouse")).new()
local trajectory = require(game.ReplicatedStorage:WaitForChild("Trajectory")).new(Vector3.new(0, -game.Workspace.Gravity, 0))
local timerClass = require(game.ReplicatedStorage:WaitForChild("Trajectory"):WaitForChild("Timer"))
local ignoreList = {game.Workspace.Terrain, script.Parent}
local hrp = script.Parent:WaitForChild("HumanoidRootPart")
game:GetService("RunService").RenderStepped:Connect(function(dt)
game.Workspace.Terrain:ClearAllChildren()
local dir = (mouse.Hit.p - hrp.Position).Unit
local x0 = hrp.Position + dir*2
local v0 = dir*SPEED
local path = trajectory:Cast(x0, v0, Enum.Material.Plastic, ignoreList)
trajectory:Draw(path)
end)
mouse.Button1Down:Connect(function()
local dir = (mouse.Hit.p - hrp.Position).Unit
local x0 = hrp.Position + dir*2
local v0 = dir*SPEED
local ball = game.Players.LocalPlayer.Character.HumanoidRootPart
ball.Parent = game.Workspace
game.ReplicatedStorage.unlockCharacter:FireServer(game.Players.LocalPlayer)
table.insert(ignoreList, ball)
local path = trajectory:Cast(x0, v0, Enum.Material.Plastic, ignoreList)
trajectory:Travel(ball, path)
script.RemoteEvent:FireServer(game.Players.LocalPlayer)
end)
``` (in starter character scripts)