How do I get one part to follow another part's orientation/rotation?

Basically in the following script, this person hovers above the character but won't follow the oreitation/rotation of the character.

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Mouse = Player:GetMouse()

while true do
	Character["Fire Mage"].HumanoidRootPart.BodyPosition.Position = Character.Torso.Position + Vector3.new(0,7,0)
	Character["Fire Mage"].HumanoidRootPart.Orientation = Character.HumanoidRootPart.Orientation
	wait(0.05)
end

3 comments

0

You can use rotation = CFrame - CFrame.p which will leave only the rotation.

0

I would just use welding if you want the same orientation and rotation of the other part. http://wiki.roblox.com/index.php?title=Weld

0

You can use a property of the CFrame.new(Part1,Part2) this'll make part1 look at part2.