Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Morphing works, but camera isn't moving?

Asked by 3 years ago

Hi!,

I am working on a game whoops sorry an "experience"

In this "Experience" the player is supposed to click a model and swap bodies with the model they clicked on, I've succeeded in the changing bodies aspect but the camera refuses to move, I've tried changing the CFrame, the subject, but nothing works, If you were looking for my code it is below

01--Vars
02------------------------------------------------------------
03local jerryModel = script.Parent
04local jerryUnion = script.Parent.JerryUnion
05local clickDetect = script.Parent.ClickDetector
06local char = game.Workspace.Character
07--Useful Funcs
08------------------------------------------------------------
09function cloneChar(character)
10    character.Archivable = true
11    local clone = character:clone()
12    character.Archivable = false
13    return clone
14end
15 
View all 32 lines...

If anyone could help me I would appreciate it, I've been struggling with this for a while now

0
Did you check if your character is moving? If its not moving then thats the problem not camera acediamondn123 147 — 3y
0
@acediamodn123 My char is moving, its the camera that isn't following it ayuu1234 0 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

Add an offset to the CFrame of the camera. So instead of doing cam.CFrame = player.Character.CFrame do cam.CFrame = player.Character.CFrame * CFrame.new(0,2,0). I suggest you look at this article here: https://developer.roblox.com/en-us/articles/Understanding-CFrame

0
The Camera just isn't moving, it's stuck at where my player was ayuu1234 0 — 3y
0
Yup then you should use RunService to update it every frame, so it can follow the player as they move around acer1102 97 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

i wish i could help but i am not an advanced scripter yet I'm still learning about instance.new and all those stuff lol ;-;

Answer this question