Error with :GetPrimaryCFrame()

Do you mean this?
error

Yes. That is not an Engine error, that is a mistake in your code. You have to be removing/moving your PrimaryPart at one point. Also I see you use GetPrimaryCFrame() I haven’t seen that one before, maybe it is deprecated? use GetPrimaryPartCFrame()

Also the print() never showed any errors? What did it print() then?

1 Like

It printed the model’s primary part name. Also, I do not use GetPrimaryCFrame() or GetPrimaryPartCFrame() in any scripts. I checked my game many times and there was no script using that.
Edit: Usually if a script produces an error, there would be a blue line under the red line, but there was no blue line under this error line, so…

So you get the error if you test it right? Did you try clicking the error while you are testing without clicking on stop?

1 Like

Yes, I get the error when I test the game. I tried clicking both in-game and after I stopped the game, but both didn’t work.

Ohhhh I see, you aren’t trying to grab the PrimaryPart’s CFrame. Sorry I misread your post.

Also errors aren’t just blue, there are red and yellow ones too.

It has to be coming from some virus/bug or a script.
Edit: (so you have check all models and plugins in your game?)

1 Like

I have checked, and the plugin worked normally everyday, and there weren’t any plugin update. I also checked every model and viruses, but there weren’t any.

1 Like

Try running this script in the command bar, it should list any scripts that use GetPrimaryCFrame or GetPrimaryPartCFrame.

local places = {
	"ServerScriptService",
	"Workspace",
}

for _, place in ipairs(places) do 
	for _, v in pairs(game[place]:GetDescendants()) do
		if v:IsA("LuaSourceContainer") then
			if v.Source:match("GetPrimaryPartCFrame") or v.Source:match("GetPrimaryCFrame") then
				warn(string.format("Script '%s' uses GetPrimaryCFrame/GetPrimaryPartCFrame. Containing place: '%s'", v.Name, place))
			end
		end
	end

end
3 Likes

Nothing was printed. I’m pretty sure that there aren’t any scripts that are using the function.

Does this happen when hitting run or play?

1 Like

When hitting play only, it seems.

Try with

local places = {
	"StarterPlayer",
	"StarterGui",
	"ReplicatedFirst"
}

for _, place in ipairs(places) do 
	for _, v in pairs(game[place]:GetDescendants()) do
		if v:IsA("LuaSourceContainer") then
			if v.Source:match("GetPrimaryPartCFrame") or v.Source:match("GetPrimaryCFrame") then
				warn(string.format("Script '%s' uses GetPrimaryCFrame/GetPrimaryPartCFrame. Containing place: '%s'", v.Name, place))
			end
		end
	end

end
2 Likes

Script ‘BaseCamera’ uses GetPrimaryCFrame/GetPrimaryPartCFrame. Containing place: ‘StarterPlayer’

Isn’t that Roblox Core’s Script?

No, that’s a fork of the camera as the camera scripts are placed there on runtime. So it is probably different from the standard camera script

2 Likes

Thank you so much. So how do I find this “BaseCamera” script?

You can just search in the search bar in the explorer: image

2 Likes

Sorry if this is outside the subject a little bit, but I checked the script and its ancestor is PlayerModule (which is a Roblox Core’s Script), and I didn’t fork this ModuleScript, so isn’t this a Engine Bug?
Does it have anything to do with this, because I’m using it: How to disable player controls with new PlayerScript layout? - #4 by daireb

Is this in studio or when running the game? If it’s in studio then it is not an engine bug as you are using a custom camera script.

1 Like

A custom camera script? I’m afraid I don’t understand, can you please explain further?

If you add a PlayerModule script in studio that script replaces the roblox-made one.