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

Motor get's instantly destroyed upon moving the part and teleport's to part1?

For some reason the motor get's instantly destroyed? I'm trying to basically make a wing flap, But i cant even move the wing and put it in the right position without the motor destroying it and when i have the part0 in the right position then add it to the motor? part0 just instantly teleport's to part1, Why is this so hard? help!

rightwing.DesiredAngle = -30
leftwing.DesiredAngle = -30
wait(1)
rightwing.DesiredAngle = 30
leftwing.DesiredAngle = 30

Am i doing it all wrong?

1 comment

0

Are you move the motor with the wing?

1 answer

✓ Accepted answer

The relation between the motor's Part0 and Part1 parts is defined by the C0 and C1 properties, so that:

part1.CFrame * C1 == Part0.CFrame * C0

From weld api page

You can set a weld to the existing world space relation by using just the C0 property, and the Inverse of Part0's cframe. This is also exposed via a ToObjectSpace method

weld.C0 = weld.Part0.CFrame:Inverse() * weld.Part1.CFrame
-- or using the method
weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)

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