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

How do I return the direction a block is turning?

Asked by
PhaZeRO 30
7 years ago
Edited 7 years ago

I'm making a custom camera for a racing game and I want it to swing side to side when the player turns the vehicle.

I came up with this which returns how fast the vehicle is spinning but the camera will only swing to one side because it doesn't check which direction it is spinning.

(Part.RotVelocity * Part.CFrame.upVector).magnitude

1
You can check if the A or D key is pressed ;) RubenKan 3615 — 7y
0
PhaZeRO, you can use .Direction <--- I'm pretty sure that works. It would be like (Part.RotVelocity * Part.CFrame.upVector).Direction AstrealDev 728 — 7y
0
lol it's v.Unit not v.Direction. And in reality all vectors have a direction; unit only gives you an equalized version which is more useful. cabbler 1942 — 7y

Answer this question