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

Bow Limb Bending at Incorrect Spot? [closed]

Asked by 7 years ago

This script is an example of the bending of two bow limbs. The bottom limb bends correctly, but the top limb bends at the incorrect point, thus creating a visible gap (see picture). Picture

I can't figure out how to change the bending point of the top limb so it bends at the other end, like the bottom limb. Here's the script:

local tool = script.Parent
local l1 = tool.Limb1
local l2 = tool.Limb2
bowLimb = l1
angle = .02
for i = 1,30 do
    wait(0.01)
    bowLimb.CFrame =
    bowLimb.CFrame *
    CFrame.new(-bowLimb.Size.X/2, -bowLimb.Size.Y/2, 0) * --The problem is somewhere within these lines.
    CFrame.Angles(0, 0, angle) *
    CFrame.new(bowLimb.Size.X/2, bowLimb.Size.Y/2, 0)
end
bowLimb = l2
for i = 1,30 do
    wait(0.01)
    bowLimb.CFrame =
    bowLimb.CFrame *
    CFrame.new(-bowLimb.Size.X/-2, -bowLimb.Size.Y/-2, 0) *
    CFrame.Angles(0, 0, -angle) *
    CFrame.new(bowLimb.Size.X/-2, bowLimb.Size.Y/-2, 0)
end

Closed as Not Constructive by Goulstem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 7 years ago

Okay well, I fixed it by rotating the top limb 180 degrees, then multiplied the CFrame by the inverse of the angle on line 11.

Ad