So I have been recently working on a flying boss, and since then I wanted to add a attack such as a homing missile that could be damaged by the player in order to destroy it. However, when starting to make the basics such as making it home in. I have not found a good way to do it and I have done some searching and it seems that RocketPropulsion is depracted after checking on the documentation.
So I decided to use LineForce, so far I have just been trying to figure out how to get my Rocket to fly at the NPC as a test. So far the missile has flung around and has done the complete opposite of reaching the NPC. Any ideas?
Wow! It works perfectly! How would I make it slower, giving the player more time to react. And also a way to face it towards the player so its a more aiming type of missile.
Glad it was useful. To make it slower, set the responsiveness property to a lower value or you can have an invisible part that can be followed by the missile to the player.
To make it face towards the player, you can simply do like this:
My main idea is to use 2 attachments in the game, and have 1 be in the players primarypart known as the targetattachment. Currently my main idea is to clone the missile and then set the things there.
local function FireRocket(target, rocket_health)
local Missile = BossAssets:WaitForChild("InfernalMissile"):Clone()
Missile.Parent = Effects
Missile:MoveTo(Infernal.PrimaryPart.Position)
Missile.Humanoid.MaxHealth = rocket_health
Missile.Humanoid.Health = rocket_health
local MissilePrimary = Missile.HumanoidRootPart
MissilePrimary.AlignPosition.Attachment1 = target.HumanoidRootPart.TargetAttachment
end
For the health, you can simply use Instane:SetAttribute(Property, Value) or use a IntValue.
And if you want to have control over all the missiles in the game, you can use the CollectionService, like this:
For the buggy missile, try Rocket.PrimaryPart:SetNetworkOwner(nil). (Make sure you run this line after you put it in the workspace, or else it will throw an error.)
And I am no expert on Humanoid, and a fairy long code may be needed to set a linear speed, which I am no sure. I will tell you once I have ideas
Hello back…
I can not visualize what you mean by rocket going below, maybe send me a video
But I am guessing this:
Presuming target.HumanoidRootPart.TargetAttachment is not used by other scripts or by roblox
You could make it go a little above by setting its CFrame
target.HumanoidRootPart.TargetAttachment.CFrame = target.HumanoidRootPart.TargetAttachment.CFrame + Vector3.new(0, 10, 0)
-- x, y, z
This will make the Attachment go up relative to HumanoidRootPart
That could work, After testing, I think creating a new part is the best method as setting the target will completely ruin the players physics in general. Any idea on the targeting system since a new part constantly tracking the player would be difficult.
Problem, it spits out multiple rockets. However I have realised that the Player automatically has a Attachment inside their HRP called “RootJoint” so there is no need for the target attachment.