Hey there, currently i’m trying to make a S.A.M (Surface to Air Missile) system. I don’t know where to start in terms of guidance. I’ve used things like CFrame lookAt but that just faces the object instead of being like an actual missile. If anyone can help please let me know I can send a screenshot below
You can use the :Lerp function of CFrame. Watch videos about it on YouTube.
Basic missile guidance could be just having the missile’s target be where the target will be by the time the missile is able to contact it. Given that the target is travelling in a straight line, you know that the place the target will be in a given time interval by its
position + its velocity * the time that will pass
The issue with Lerp is that it just goes to where the object is, not where it is going.
I see so have the missile originally launch towards the target then im guessing some division of positions?
oh i see p + v * t
many numbers and letters
Try experimenting with rocket repulsion. Heres a link to the api of it: RocketPropulsion | Roblox Creator Documentation
Thanks, I will have a look at it.
can you explain more on this mainly the formula to have the missile lead the target im trying to make my own missile lol
I know this is more than a year old, but you’re looking for something called “proportional navigation.” It’s an extremely popular missile guidance algorithim and was used by some of the earliest infrared guided missiles (most notably the AIM-9B) because of its simplicity. It works as follows: the seeker head obtains a heat signature and subsequently obtains the Line of Sight (LOS), which is essentially the unit vector of the distance to the target.
local lineOfSight = (target.Position - seeker.Position).Unit
By tracking the target and repeatedly measuring the line of sight, the guidance computer can calculating the rate of change of the target’s bearing relative to the missile.
Finally, to fly the missile to the target, the guidance computer calculates the command acceleration which is essentially the necessary rate of change of velocity for the missile to intercept the target. Command acceleration can be either normal to the missile’s velocity vector or the line of sight, and its magnitude is proportional to the rate of change of the line of sight, hence the name “proportional navigation”. The constant of proportionality, N, is usually between 3 to 5.
Missile guidance is an extremely complex topic, WW2 scientists could not figure it out, the creation of this guidance algorithm was a huge break through and it became the standard for missile guidance for several decades. So if you’re struggling, don’t worry.
Thanks for this, I never ended up completing this but I might go back to it now because of your comment.