How would I go about making a tracking missile / part?

You can still do that! Just as long as you reference a BasePart Instance within the 2nd parameter of CFrame.new() to be that specific Part, and there are honestly so much ways you can sanity check within your Touched function; here are a couple of examples that I can provide:

  • if Part.Anchored == true then
  • if Part.Name == "TargetPartHere then
  • if Part:FindFirstChild("ImportantObjectHere") then
  • if Part:GetAttribute("SpecificAttributeHere") == true then

Just do what works best for you :wink: (And for Dave’s sake as well cause he risked his life just for this)

also, if the target is in the air, it doesnt work… do you know how to fix that?

Did you set the properties of each Instance correctly? And did you make sure to follow every line of code? It completely works fine for me when I test it in Studio:

NOW TOM IS DEAD.

1 Like

ill check that out… Maybe I set the properties wrong

I did fixed my tween problem. Switched it to Bodyvelocity. Since I don’t know how to use the new ones, I just went with the deprecated instances, but it shouldn’t do a difference.

Use RayCast to help you get a way better detection over Touched Event.

isn’t raycast for like beams or something?

Quick recap:

  • LinearVelocity Properties

    • Attachment0 should be equal to your Attachment that is within your Missile
    • MaxForce should be equal to math.huge
  • AngularVelocity Properties

    • Attachment0 should be equal to your Attachment that is within your Missile
    • MaxTorque should be equal to math.huge
  • Both should be parented inside your Missile, alongside the Attachment as well

@KultDeeri Even if it doesn’t, it’s more recommended to switch to the latter in case BodyVelocity officially gets removed from the API (It’s currently within the deprecated state as of now)

Not exactly, you can use it to send a ray from the Position of the Missile, then the lookvector for the distance of the ray. But if you aren’t looking for that. You can as well use spatial querys [Overlap Params], to help you instead.

Do you know why the attachments are needed for?

Here’s my version of the script, though @Jackscarlett uses AngularVelocity, which I don’t know what it does. Mine uses just LinearVelocity and Spatial Query instead.

Whatever works best for you, good luck on your game as well. :slight_smile:

Speed = 50

local Target = game.Workspace.Dummy.HumanoidRootPart
local Missile = game.Workspace.Follow

local LV = Instance.new("LinearVelocity", Missile)
LV.Attachment0 = Missile.Attachment
LV.MaxForce = math.huge

local OP = OverlapParams.new()
OP.FilterDescendantsInstances = {}
OP.FilterType = Enum.RaycastFilterType.Blacklist

game:GetService("RunService").Heartbeat:Connect(function()
	Missile.CFrame = CFrame.new(Missile.Position, Target.Position)
	LV.VectorVelocity = Missile.CFrame.LookVector * Speed
	
	task.spawn(function()
		local Hit = game.Workspace:GetPartsInPart(Missile, OP)
		
		if #Hit == 0 then return end
		for i,Touch in (Hit) do
			if Touch:IsA("BasePart") then
				local Humanoid = Touch.Parent:FindFirstChildOfClass("Humanoid")
				if Humanoid then
					Humanoid:TakeDamage(50)
					Missile:Destroy() -- Destroy when touch?
				end
			end
		end
	end)
end)

they both seem to work the same/similarly because I dont notice a difference, thx

Here is my personal assumption, and I’m unsure if this is actually what the case is true or not but this is just me speaking out opinions:

Attachments were added to LinearVelocity & AngularVelocity because they’re now considered a type of Constraint that ROBLOX changed ever since they subsided the Legacy BodyMovers (BodyAngularVelocity, BodyGyro, etc), and it was for quite a while as well (March 22nd, 2022 to be exact), but unfortunately I highly doubt they’ll plan on improving them as more people tend to prefer using Constraint type objects, such as (WeldConstraints & Motor6Ds) as they’re far better than the old BodyMovers

1 Like

really creative, funny, and detailed explanation tho, that really cleared things up. Thanks, gl on any future projects. RIP Dave

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.