How do a make a projectile go to my cursor?

I made a model and I have no idea on how to fire it, I want it to go to where my cursor is but I cant seem to do it. Help!

code just in case you need it:

local HookProjectile = HookModel:Clone()
				
				    HookProjectile.Parent = workspace
					HookProjectile.CanCollide = false
					HookProjectile.CFrame = HumRP.CFrame * CFrame.new(0,0,0)
					HookProjectile.CFrame = CFrame.new(HookProjectile.Position,MouseHit.p)

					HookProjectile.Touched:Connect(function(Hit)
					local db = false
					if Hit.Name == "Union" then
						if not db then
								db = true

							HookTouched(Player,HookProjectile,HookModel,AmountOfHooks)
							
							end
						
						HookProjectile:Destroy()
						db = true
						
					    end
					end)

					game.Debris:AddTag(HookProjectile,2.5)

					delay(2.2,function()
						local Tween = TS:Create(HookProjectile,TweenInfo.new(0.3),{Transparency = 1})
						Tween:Play()
						if AmountOfHooks.Value <= 0 then
						end
					end)
And the function I call in the script above.
function HookTouched(Player, Projectile, Model, AmountOfHooks)
	local HookPostition = Projectile.Position
	local NewHook = Model:Clone()
	NewHook.Parent = workspace
	NewHook.Position = HookPostition
	NewHook.Anchored = true
	NewHook.Rotation = Projectile.Rotation
	NewHook.Name = "HookUsed"
	local Rope2 = Instance.new("RopeConstraint")
	Rope2.Attachment0 = NewHook.Attachment1
	Rope2.Attachment1 = Player.Character:FindFirstChild("Torso").BodyFrontAttachment
	Rope2.Thickness = .2
	Rope2.Visible = true

	Rope2.Length = (NewHook.Position - Player.Character.HumanoidRootPart.Position).magnitude - 1

	Rope2.Parent = NewHook
	AmountOfHooks.Value = AmountOfHooks.Value + 1
end

People have told me to use vector force, but I dont know how to do that, and other topics say linear velocity and I dont know what that is either. What is the best way to do this?

the problem is you teleport the part you could find out the hit pos and let the projektile tween there
Tween docs

I cannot use tweens, they are to laggy to use for projectiles.

Get the mouse, then check the position of the mouse, if your handling the rocket from serverside, you’ll need to fire a remote to get the position.

A simple start would be:

local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()

As for the rest, you can easily find tutorials / etc on youtube.
[DevForum post]
[Youtube Tutorial]

I have the mouse position, so I’ll check out those videos!

OH MY GOD THANK YOU!!! You have no idea how long ive had this stupid problem for!!! You fixed it and it works great!

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