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

How do I make the wheels of a car spin?

Asked by 3 years ago

I am creating a cutscene for the opening of my game. The cutscene follows a moving car, now I can get the car model to move forwards, but it looks stupid as the tyres don't rotate.

Any ideas on how I would achieve this?

I have tried by using this very simple script, but it doesn't work, as the tyre flips 90 degrees.

for i = 0,100,1 do 
    script.Parent.Rotation = Vector3.new( 0, i, 0)
    wait()
end

Hope this makes sense.

1 answer

Log in to vote
1
Answered by 3 years ago

Assuming you dont care if the wheels perfectly match up with the road:

while true do
 script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0.02,0)
 wait()
end

If you must have the wheels match the road, you're going to have to use a full car with physics & such unless some experienced coder happens to see this thread.

0
This is perfect. Thank you! ConnorThomp 87 — 3y
Ad

Answer this question