Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Replicate a models rotation?

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

gl with velocity ^_^

1 comment

0

This isn't a forum. Unless your answer is legitimately answering the question don't bother answering.

This discussion is preserved as it was. New answers, comments, and votes are closed.