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

Rotational Error, rotates completely wrong. Any help?

Asked by
Kurcha 33
6 years ago

I have a rotational error, and it hasn't fixed.

01zenabled = true
02local soldier = script.Parent.Parent.Parent[""]
03while wait() do
04local closest = nil
05local dist = 12.5
06for _,bloons in pairs(workspace.Bloons:GetChildren()) do
07if bloons then
08local mag = (script.Parent.Parent.Parent.Parent.Position-bloons.Position).magnitude
09if mag < dist then
10        closest = bloons
11        dist = mag
12        soldier:SetPrimaryPartCFrame(CFrame.new(soldier.Torso.Position,
13        Vector3.new(bloons.Torso.Position.X, soldier.Torso.Position.Y,                                                  
14                bloons.Torso.Position.Z))*CFrame.Angles(0,-math.pi/3,0))
15end
View all 68 lines...

This is supposed to rotate towards 'bloons'. Any help?

0
Huh? What do you mean? TerrodactyI 173 — 6y
0
It rotates in the wrong way. It is faced a bit away from the object. Kurcha 33 — 6y

Answer this question