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

Rotating the Camera to the rotation of a brick??

Asked by
legosweat 334 Moderation Voter
8 years ago

I have tried ":toEulerAnglesXYZ()" and ".lookVector" but I'm having no luck.

Basically what I have already done is make the Camera follow the part when it moves, but now I'm trying to rotate the Camera to be always facing the front of the brick (the current side it's facing) even while it's being rotated.

How would I get the radians of the part and apply it to the camera?

Please answer this, I need all the help I can get! :")

1 answer

Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
8 years ago

CFrame is both position and rotation, remember?

The following therefore works fine:

camera.CFrame = part.CFrame
0
Uhh, but how would I rotate the brick and match the Camera to that rotation? legosweat 334 — 8y
0
Lol, nice answer. User#11440 120 — 8y
0
You do exactly what I said. CFrame is both position and rotation, so the above code will rotate the camera as well as position it to the brick. Perci1 4988 — 8y
Ad

Answer this question