How do I use target Position?

So I was trying to script a homing missile using RocketPropulsion and BodyGyro so that the missile can point itself to the target correctly. The problem arose when i was scripting and got to the part at the end: “targetPosition”. I think that im supposed to define a target for the body gyro to face but I dont know how exactly how to do that. Is anyone able to help?

local BodyGyro = game.Workspace.AIM.BodyGyro

--RocketPropulsion
script.Parent.RocketPropulsion.Target = workspace.P2
script.Parent.RocketPropulsion:Fire()

--BodyGyro
CFrame.new(BodyGyro.Parent.Position, targetPosition)

here’s the script
I’ve looked around on the dev forum and the dev hub but there doesn’t seem to be any explanation on how to do it.
(sorry if this is something really easy I’m new to scripting)

1 Like