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

How to tween a bricks weld position trouble shooting? (CFrame)

Asked by 10 years ago

Wgun is the weld, dg[1] is the x difference from the current position and the new position [2] is Y [3] is Z. Frames is obviously the frames. SPEED is to let the loop know which frame it is currently looping. g is the current x,y,z The problem is it keeps spazing the gun back and forth (In rotation). I also tried printing the difference and it keeps giving me 0 (With the values listed below) How do I smoothly edit the CFrame of a moving object?

Here are some reference points:
walking animation 1
g1walk = {1.5,5.2,-2.5}

walking animation 2
g2walk = {.2,5.2,-3.2}

    wgun.C0 = CFrame.new((dg[1]/frames) * SPEED +g[1],(dg[2]/frames) * SPEED +g[2],(dg[3]/frames) * SPEED +g[3])

Answer this question