My camera lock at other place

Hi , I’m new at Lua scripting language. I try to make my own game and I got a many problem and this is one of those.
What I am going to create is edit character part. I learned this script from youtube.
I want to lock camera at player’s character while editing. The problem is camera work like i want but it just lock at other place. I have no idea why because there’s nothing. This is my script. Please help me check it out.

1 Like

Sorry for the late response: did you get any errors?

I think no , bc I look at “go to script error commit” but the icon doesn’t has anything

Now I try a lot of code by other youtuber but the result always the same.

I don’ even know what’s the problem. TwT

Alright, so, this is called camera manipulation what you’re trying to do here.

Api Refrence here.

Here is an example script too!

(I tried to explain it too, remember to research and understand a topic!)

local camera = workspace.CurrentCamera --Finds camera
local part = workspace.CameraView -- Name of new camera part

camera.CameraType = Enum.CameraType.Scriptable --Set camera Type

camera.CameraSubject = part --Set Camera Subject
camera.CFrame = part.CFrame --Set camera CFrame to part CFrame

It if worked make sure to make it a solution,

Happy learning!

REMEMBER: Always try to understand the code you’re writing, this will make you a good scripter!

If you don’t understand the code, ask me or another scripter, or research for yourself! :star2:

Thank you very much

As you see , I copied your whole script and it’s work!

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