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

Replicate a models rotation?

Asked by 9 years ago

I'm using Filtering Enabled and controlling on the client side and replicating to the server in order to avoid input lag, but you can ignore that. I'm simply trying to set Model A's Rotation as Model B's constantly. I've been trying for ages using several different methods but I can't seem to get anything to work.

I get model A's rotation,

local _,_,_,c00,c01,c02,c10,c11,c12,c20,c21,c22=p.Core.CFrame:components()
local Ay=math.atan2(c02,c22) local Az=math.atan2(c10,c11) local Ax=math.asin(c02)

Then attempt to set it as B's. I'm using BodyGyro as CFraming the entire model would cause lag, therefore I take away Model A's rotation from B and then cframe that much on gyro.

local _,_,_,c00,c01,c02,c10,c11,c12,c20,c21,c22=p.Core.CFrame:components()
local Ay=math.atan2(c02,c22) local Az=math.atan2(c10,c11) local Ax=math.asin(c02)
local x,y,z=Ax-Anglex,Ay-Angley,Az-Anglez
p.Core.g.cframe=CFrame.new(0,0,0)
*CFrame.Angles(x,0,0)*CFrame.Angles(0,y,0)*CFrame.Angles(0,0,z)

This yet again doesn't work, any suggestions appreciated =P

1 answer

Log in to vote
-1
Answered by
ausmel105 140
9 years ago

gl with velocity ^_^

0
This isn't a forum. Unless your answer is legitimately answering the question don't bother answering. Goulstem 8144 — 9y
Ad

Answer this question