How to make Part1 follow Part2's rotation

Hey, I am making a SAM system. The aim of this is to make the top half of the SAM follow a part (acting as a missile). The issue is that I have no idea how to do this, I have experimented with :SetPrimaryPartCFrame but it didn’t work.

If anyone knows how, can you please explain it aswell because I am new to advanced CFrames.

You can use the Instance BodyGyro | Roblox Creator Documentation or AlignOrientation | Roblox Creator Documentation

1 Like

I used AlignOrientation and it doesn’t move the part.

AlignOrientation is used to rotate a part relative to another CFrame if you want to move it use AlignPosition

No, AlignOrientation is definitely the one I need.

You said you wanted to move the part

Have you never seen an SAM before? If you can search one up it will give you a better idea of what I mean as it is hard to explain.

Struggling to understand, What exactly is a

Im not the most experienced with models but i suggest using something like this

local m1 = game.Workspace.Model1
local m2 = game.Workspace.Model2

m1:PivotTo(CFrame.new(m1.PPart.Position,m2.PPart.Position))

To explain what happens here when you call only 2 arguments which are a position it attempts to set the Orientation of a Part or a Model to look at a certain Instance in the world, The first argument is the Part that will be facing a certain part, and the second the Part it will be facing

Surface-to-air missile - Wikipedia

Does this script do what you’re trying to achieve?

local RS = game:GetService("RunService")
local Missile = script.Parent -- You can change this to the missle
local PartToHit =  -- Put the part you want to look at here
local Speed = 2 -- You can change the speed to whatever you want

RS.Heartbeat:Connect(function()
	Missile.CFrame = CFrame.lookAt(Missile.Position, PartToHit.Position)
	Missile.CFrame *= CFrame.new(0, 0, -Speed)
end)

I will test it when I can (sorry for the late reply)