#Camera not receiving

1 messages · Page 1 of 1 (latest)

nova kiln
#

so I tried making an auction/bidding game when the player presses join the auction it clones the garage into workspace and gets tped but the camera dosen't change into a part called CameraPos

#

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

hollow dove
#

thro

#

could be wrong

nova kiln
#

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

hollow dove
#

x,y,z

#

not cframe

#

and turn it back into cframe

nova kiln
#

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

hollow dove
#

thats why its nil

#

try sending just x,y,z not thro vector or cframe

nova kiln
hollow dove
#

cuz

#

i believe i could send vectors

#

but always worth a shot

nova kiln
uneven acornBOT
#

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