What do you want to achieve? I want the game camera to be following A part called “One” and this part is inside a r15 model called “CharLoader”
What is the issue? The problem is everything works well in Roblox Studio but when I play on the actual Roblox the camera shows somewhere else.
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!
local workspace = game:GetService(“Workspace”)
local charloader = workspace:WaitForChild(“CharLoader”)
local partone = charloader:WaitForChild(“One”)
gameGetService(“RunService”).RenderedStepped:connect(function()
game.Workspace.CurrentCamera.CFrame = partOne.CFrame
end)
also, maybe consider changing the CameraType to “Scriptable”. Here is an improved version of your code:
local charloader = workspace:WaitForChild(“CharLoader”)
local partOne = charloader:WaitForChild(“One”)
local camera = game.Workspace.CurrentCamera
camera.CameraType = "Scriptable"
game:GetService(“RunService”).RenderedStepped:connect(function()
camera.CFrame = partOne.CFrame
end)
No it’s not working like When I tested what you wrote on Roblox Studio it’s works and when I play it on Roblox it’s works too but when I go to an alt acc or my friend joins it doesn’t work the camera doesn’t work
Wait I just noticed you set a variable with a name “workspace”.
But game.Workspace and workspace are literally doing the same thing.
Maybe try:
local charloader = workspace:WaitForChild(“CharLoader”)
local partOne = charloader:WaitForChild(“One”)
local camera = game.Workspace.CurrentCamera
camera.CameraType = "Scriptable"
game:GetService(“RunService”).RenderedStepped:connect(function()
camera.CFrame = partOne.CFrame
end
Edit: (yeah another edit xd) I made a small typo (again decidedly) at partOne, now changed
Have you looked in game to see where the Part One is? Is the camera at that location or somewhere completely different?
As stated, if you leave the camera unscripted it probably is trying to look at your avatar because it loads in that way.
Good idea, I did that for my game, I totally forgot about that. Otherwise what I’ve made earlier was working pretty well so I’m pretty sure it’s about the part’s CFrame there
Sure. There’s a property in a base Camera object known as CameraSubject, which essentially focuses on whatever Instance you put it on. By default it focuses on the Humanoid in the character - but you can change this to something else, for example a part.
I know it’s not very “clear”, but it makes the part “One” points towards CharLoader. With these properties and the code I’ve posted earlier, it works on both Studio and game