Can Motor6D.Transform be server-sided?

  1. What do you want to achieve?
    I want to make Motor6D.Transform server-sided so all clients can see arm rotation.

  2. What is the issue?
    I tried using it in a Server Script, however, it did not work.

  3. What solutions have you tried so far?
    I modified the script from this post, but when I try to make it server sided Motor6D.Transform does not do anything at all.

If this property cannot be replicated to all other clients, is there any alternative? Any help is appreciated. Thanks for your time!

Devforum post for the property:
Link

The Transform property according to the wiki:
PartParent.CFrame * CParent * Transform == PartChild.CFrame * Child
The corresponding properties of the Motor6D are as follows:
PartParent is Motor6D.Part0
CParent is Motor6D.C0
Transform is Motor6D.Transform
PartChild is Motor6D.Part1
Child is Motor6D.C1


For animations you will want to use the Stepped event from RunService.
Connect to the Stepped event, which runs independently on server and clients, like this:

local RunService = game:GetService("RunService")
RunService.Stepped:Connect(function(time, dt)
  -- time = time elapsed since device started,
  -- dt = time elapsed since previous event fired
  print("Framerate = "..tostring(math.floor(1/dt + 0.5)))
end)

When it comes to custom animations, you will want to have a from cframe and a to cframe. And then you will want to lerp the cframe over some period of time.
The CFrame:Lerp method
I will give you some example code to do this:

local part = workspace.Object.SomePartToAnimate
local motor6d = part.Motor6D

local from_cf = part.CFrame
local goal_cf = from_cf * CFrame.Angles(math.pi*0.5, math.pi*0.3, -math.pi*0.1) -- rotate current orientation
local time_to = 1 -- in seconds

-- get the from_trans and to_trans according to wiki so we can lerp that property.
local from_trans = motor6d.Part0.CFrame:Inverse() * motor6d.C0:Inverse() * from_cf * motor6d.C1
local to_trans = motor6d.Part0.CFrame:Inverse() * motor6d.C0:Inverse() * goal_cf * motor6d.C1
local current_time = 0

local RunService = game:GetService("RunService")
local connection = nil
connection = RunService.Stepped:Connect(function(time, dt)
	current_time = current_time + dt;
	if current_time > time_to then
		current_time = time_to
	end
	motor6d.Transform = from_trans:Lerp(to_trans, current_time/time_to)
	if current_time == time_to then
		connection:Disconnect()
	end
end)

Link 2

local RunService = game:GetService(“RunService”)
RunService.RenderStepped:Connect(function(time, dt)
– time = time elapsed since device started,
– dt = time elapsed since previous event fired
print("Framerate = "…tostring(math.floor(1/dt + 0.5)))
end)

Link 3

local RunService = game:GetService(“RunService”)
RunService.Heartbeat:Connect(function(time, dt)
– time = time elapsed since device started,
– dt = time elapsed since previous event fired
print("Framerate = "…tostring(math.floor(1/dt + 0.5)))
end)

Link 4

–Source:
https://devforum.roblox.com/t/motor6d-transform-server-sided/289914

–Locals
local RunService = game:GetService(“RunService”)
local Players = game:GetService(“Players”)
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local Motor6D = Instance.new(“Motor6D”)

local Arm = Instance.new(“Part”)
Arm.Parent = LocalPlayer.Character
Arm.Name = “Arm”
Arm.Size = Vector3.new(0.2,2,0.2)
Arm.Anchored = true
Arm.CanCollide = false
Arm.CFrame = CFrame.new(3,3.5,3)
Arm.BrickColor = BrickColor.new(“Bright blue”)

local Grab = Instance.new(“Part”)
Grab.Parent = Arm
Grab.Name = “Grab”
Grab.Size = Vector3.new(0.5,0.5,0.5)
Grab.CFrame = CFrame.new(0,0,0)
Grab.Anchored = true
Grab.CanCollide = false
Grab.BrickColor = BrickColor.new(“Bright blue”)

–Motor6D
Motor6D.Parent = Arm
Motor6D.Part0 = Arm
Motor6D.Part1 = Grab
Motor6D.C0 = CFrame.new(0,0.5,0)
Motor6D.C1 = CFrame.new(0,0,0)

–Functions
function GetMousePos(mouse)
onnect(function()
Frame = CFrame.Angles(0, angle, 0) * CFrame.new(distance, 3.5, 0) * CFrame.Angles(0, math.rad(-90), 0)