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

Why are we multiplying here?

Asked by
A9X 10
8 years ago
 wpad.CFrame = CFrame.new(workspace[admin].Torso.Position) * CFrame.fromEulerAnglesXYZ(0,math.rad(i),0) * CFrame.new(0,0,-dis) * CFrame.Angles(math.rad(i),math.rad(i),math.rad(i))

I cant figure out why we multiply here, can anyone explain please?

0
Is this to find the distance of one object from another? iUnEarthly 85 — 8y
0
No, that is entirely irrelevant to what this is. 1waffle1 2908 — 8y

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
8 years ago

CFrames are a rotation matrix; you are multiplying matrices. The second matrix translates the first in relative object space.

CFrame.new(workspace[admin].Torso.Position) is a frame without rotation

CFrame.fromEulerAnglesXYZ(0,math.rad(i),0) rotates it about its own relative Y axis

CFrame.new(0,0,-dis) moves it relatively backwards

CFrame.Angles(math.rad(i),math.rad(i),math.rad(i))is another rotational factor

Ad

Answer this question