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

How do I make a part with welds attached to it rotate?

Asked by 9 years ago

I have this fish, and I have it to where swims it back and forth. But I want it to rotate every time it reaches the end of it's path. I have already tried five methods and this is the best one:


fp = script.Parent.Position while true do script.Parent.BodyPosition.position = Vector3.new(fp.x-80, fp.y, fp.z) wait(6) script.Parent.BodyPosition.position = Vector3.new(fp.x, fp.y, fp.z) script.Parent.BodyGyro.cframe = CFrame.new(0,math.pi, 0) wait(6) script.Parent.BodyGyro.cframe = CFrame.new(0,math.pi, 0) end

It doesn't rotate it however. The other methods result in the welded parts exploding all over the map, or the part just simply fall off of the moving object.

Much assistance would be greatly gratified.

1 answer

Log in to vote
0
Answered by 9 years ago

Okay I found out the issue: "CFrame.new" should be "CFrame.Angles"

Ad

Answer this question