Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make a brick smoothly rotate while Body Velocity is present?

So I have a couple of parts that are welded and It is supposed to be a rocket. When You click the engine it start to fly. However I want the rocket to smoothly turn and crash into the ground. I tried this and it does this weird snappy rotation where its like -90 90 - 180 and not .6 .12 .18 and so on. Here is the script :

flying = false
function fire()
script.Parent.BodyVelocity.velocity = Vector3.new(0,1,0)
flying = true
wait(3)
for i = 1, 10 do
script.Parent.BodyVelocity.velocity = script.Parent.BodyVelocity.velocity + Vector3.new(0,.2,0)
wait()
end
wait(2)
while flying == true do
script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector * 25
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ((math.rad(-.6)),0,0)
wait(.1)
end
end

script.Parent.ClickDetector.MouseClick:connect(fire)

1 comment

0

It works perfectly, I don't see your problem

1 answer

I'd recommend you use a BodyGyro. Change the BodyGyro.cframe, similar to the part's CFrame and change the "D" (Dampning) property of the BodyGyro to reduce the snappiness.

A great thing about Gyros are that you can set the cframe to what would point the part straight down, and give it a high D property, and it will slowly curve down to the ground (although this if not recommended if you want it to tilt a certain way).

This discussion is preserved as it was. New answers, comments, and votes are closed.