#Camera not receiving
1 messages · Page 1 of 1 (latest)
here is the debugging
10:30:26.056 CameraPos found: CameraPos - Server - AuctionJoinHandler:35
10:30:26.121 CameraPos received on client: nil - Client - LocalScript:8
10:30:26.121 Invalid CameraPos received: nil - Client - LocalScript:18
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Remotes = ReplicatedStorage:WaitForChild("Remotes")
local AuctionRemotes = Remotes:WaitForChild("Auction")
local SetCameraToPart = Remotes:WaitForChild("SetCameraToPart")
local Assets = ReplicatedStorage:WaitForChild("Assets"):WaitForChild("Auction")
local garageModel = Assets:WaitForChild("Garage")
local clonedGarage = nil
AuctionRemotes:WaitForChild("PlayerJoinedAuction").OnServerEvent:Connect(function(player)
if not clonedGarage then
clonedGarage = garageModel:Clone()
clonedGarage.Parent = workspace
if not clonedGarage.PrimaryPart then
clonedGarage.PrimaryPart = clonedGarage:FindFirstChild("Spawn")
end
clonedGarage:SetPrimaryPartCFrame(CFrame.new(0, 5, 0))
end
local spawnPoint = clonedGarage:FindFirstChild("Spawn")
if not spawnPoint then
warn("Spawn point missing in garage model")
return
end
player.Character:PivotTo(spawnPoint.CFrame + Vector3.new(0, 3, 0))
local cameraPos = clonedGarage:FindFirstChild("CameraPos")
if cameraPos then
print("CameraPos found: ", cameraPos)
SetCameraToPart:FireClient(player, cameraPos)
else
print("CameraPos part missing in garage model")
end
end)
ServerSided script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local camera = workspace.CurrentCamera
local cameraRemote = ReplicatedStorage:WaitForChild("Remotes"):WaitForChild("SetCameraToPart")
cameraRemote.OnClientEvent:Connect(function(cameraPos)
print("CameraPos received on client:", cameraPos)
if cameraPos and cameraPos:IsA("BasePart") then
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cameraPos.CFrame
RunService:BindToRenderStep("LockCam", Enum.RenderPriority.Camera.Value, function()
camera.CFrame = cameraPos.CFrame
end)
else
warn("Invalid CameraPos received:", cameraPos)
end
end)
Client-Sided
dont think u can send cframe
thro
could be wrong
wbt if I used Camera.CameraSubject
will that work?
but i don't think that's the problem the client dosen't even receive the camera from server
10:30:26.056 CameraPos found: CameraPos - Server - AuctionJoinHandler:35
10:30:26.121 CameraPos received on client: nil - Client - LocalScript:8
just maybe send raw data like
x,y,z
not cframe
and turn it back into cframe
but look why the client dosen't receive the cam even tho i fired it in server
it says that it receives nil not cameraPos
that means it didn't receive well the event
did u understand?
so i don't think there is no issues with cFrame rn because it looks the issue is client is not even receiving the cam
i just believe u cant send these stuff thro remote
thats why its nil
try sending just x,y,z not thro vector or cframe
i'll try that
i am just tryinf random stuff
cuz
i believe i could send vectors
but always worth a shot
it did actually work
** You are now Level 1! **