Remote Function returning nil?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’m making a morph
  2. What is the issue? Include screenshots / videos if possible!
    When the player morphs their camera is stuck in place
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I did but no work :frowning:
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Server (Module script)

local Morph = {}
function Morph:morphInto(target : Player, morphModel : Model)
	local isR6 = script.Parent:GetAttribute("R6")
	local OldCharacter = target.Character
	local morphRoot = morphModel:FindFirstChild("HumanoidRootPart")
	morphRoot.Anchored = false
	morphModel:PivotTo(morphRoot.CFrame)
	target.Character = morphModel
	print("Is R6: " .. tostring(isR6))
	if isR6 then
		local animateR6 = script:WaitForChild("R6"):WaitForChild("Animate")
		animateR6:Clone().Parent = target.Character
	else
		local animateR15 = script:WaitForChild("R15"):WaitForChild("Animate")
		animateR15:Clone().Parent = target.Character
	end
	local camera = script.Parent.GetCamera:InvokeClient(target) -- nil
	camera.CameraSubject = morphModel:FindFirstChildWhichIsA("Humanoid")  
end
return Morph

Local script

game.ReplicatedStorage.MorphService.GetCamera.OnClientInvoke = function()
	return workspace.CurrentCamera
end

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

A player’s camera does not exist on the server, handle setting the camera subject property on the client.

2 Likes

I think you replied to the wrong person.

my bad my bad my bad my bad my bad

1 Like

Either way, do read my previous message as it is the solution to your issue.

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