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

Use Camera CFrame angles only?

Asked by
Bman8765 270 Moderation Voter
9 years ago

I am currently working on a gun script and I'm having some issues with construction of arm movement. I want the arms to stay with the body but rotate with the camera instead of the head. Is there any use to use camera.CoordinateFrame but instead of getting the entire CFrame you only get the angles of the camera? Sorry I did not show any code, the question is simple and a code example is not really necessary or it would just over complicate the whole thing, if this is an issue I'll show you what I have.

Thanks for the help! Contact me if you have any questions!

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

The easiest method is to just subtract out the Position component:

cf = workspace.CurrentCamera.CoordinateFrame
RotOnly = cf - cf.p

I don't understand exactly what effect you're aiming for, so I can't give you any advice more specific than that.

Ad

Answer this question