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

How do I fuse two CFrames?

Asked by 4 years ago
Edited 4 years ago
Camera.CFrame = game.Players.LocalPlayer.Character.Head.CFrame + Vector3.new(0,50,0)

Camera.CFrame = CFrame.new(Camera.CFrame.Position, game.Players.LocalPlayer.Character.Head.Position)

I have these 2 CFrames, but they are 2 lines and I wanna make it 1 line.

Camera.CFrame = game.Players.LocalPlayer.Character.Head.CFrame + Vector3.new(0,50,0) * CFrame.new(Camera.CFrame.Position, game.Players.LocalPlayer.Character.Head.Position)

and this one just errors.. any idea?

2 answers

Log in to vote
0
Answered by
sleazel 1287 Moderation Voter
4 years ago

What do you mean by "fusing" two CFrames? CFrame describes complete part Position and Orientation. You may try to interpolate beetween two CFrames and a CFrame that would be a result of mean average. But I think that is not what you are looking for.

My best guess here is that you are trying to change Camera's CFrame so that its Position is 50 studs above character's head and Orientation facing that head. If that is what you want, just use CFrame.new like this:

Camera.CFrame = CFrame.new(Camera.CFrame.Position + Vector3.new(0,50,0), game.Players.LocalPlayer.Character.Head.Position)

Hope this helps!

Ad
Log in to vote
1
Answered by 4 years ago

Wow already answered!

Answer this question