how to rotate part to face camera direction?
Asked by
4 years ago Edited 4 years ago
I have a tool that makes a part that has a decal on it when the player clicks the mouse but the issues is that the part is always facing one direction and it never changes:
backup if image doesnt load: https://gyazo.com/0bd31f80bf70f483cf6190ef5a048a6e
so my mission is to make the part face upwards depending on where the player's camera is facing when the mouse was clicked like this:
backup if image doesnt load: https://gyazo.com/54d2e97b5cfd282256b14f9cd4a2ebe0
my code:
1 | local part = Instance.new( "Part" ) |
3 | part.CanCollide = false |
4 | part.Size = Vector 3. new( 7 , 0.1 , 7 ) |
5 | part.Position = Vector 3. new( 0 , 5 , 0 ) |
7 | part.CFrame = CFrame.new(position) |