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

How do I make this homing projectile?

I've been trying to make a homing bullet simular to the one in cuphead yall get the idea

code:

local TS = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(
	1,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)


for i,v in pairs(game.Workspace:GetChildren()) do
	if v:FindFirstChild("Humanoid") then
		if not game.Players:FindFirstChild(v.Name) then
			local target = v
			local tween = TS:Create(script.Parent, tweeninfo,  {Position = target.HumanoidRootPart.Position})
			tween:Play()
		end
	end
end

wait(5)
script.Parent:Destroy()

1 answer

G'day! Like you, I don't have much experience in homing missiles, but I did a simple google search and found this: RocketPropultion

The RocketPropulsion object applies a force on a part so that it both follows and faces a target part. It acts like a hybrid of BodyPosition and BodyGyro. Unlike other BodyMovers, a RocketPropulsion must be instructed to begin applying a force: call Fire to start, or call Abort to stop.

Hope it helped, SuperPuiu.

2 comments

0

I'll check into it but I want it to follow the nearest non-player character

0

It works for anything, it just have to be a block, read the article I put

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