Radar lock is something for fighter jets , early warning aircraft , icbm locks and CIWS detection .
I am trying to make a lock but I dont know where to start ,
Your plane’s target should be in a 90 degree vertex cone angle in front of your plane to appear as a lockable target (a screen gui hovering above the target) , the target has to hover in the angle for a few given seconds to be confirmed as a target(screen gui hovering above the target changes from white to green) .Then a cursor (screen gui)will move to the nearest confirmed target to the front of plane at a given speed , once the cursor touches the target’s gui then the target has been locked on . but if the target leaves the 90 degree angle then it will lost confirm , lost lock and its gui will disappear.
if the target deploy flares then it willlost your lock.
What things should I learn in order to achieve all of these ? Where should I start ?
1 Like
You should probably start with the first requirement
You can measure the angle with these given information
-
Plane look vector (front of the plane)
-
Position vector from plane towards the target position (target.Position - plane.Position)
Then you can measure the angle between those two using the angle between vectors formula. This will represent the conical angle as mentioned.
Then you will need the loop through and find this with a list of all the possible targets in workspace preferably via collection services.
5 Likes
I want to add to this by figuring out the time part which is pretty easy where you can use tick() to find if they have stayed inside the targeted Postion to lock it by find the tick when they first enter and ticking until it is the time you so basically new tick-old tick = amount
I am now using my modified turbofusion planes with a modified lock , that classic usses Mouse.Hit.p to find the distance between the mouse’s world position and the target’s position . However , I would like to replace Mouse.Hit.p with the plane look vector
How to find a front look vector ?
Am I using it correctly ???
–90 degree cone angle has been replaced by fixed distance on screen
Here comes the modified script
local myHead = Character.Head
local M = Game.Players.LocalPlayer.Mouse
local TorsoPos = Target.CFrame
local Distance = (myHead.CFrame.p - TorsoPos.p).magnitude
local MDirection = (M.Hit.p - myHead.CFrame.p).unit
local Offset = (((MDirection * Distance) + myHead.CFrame.p) - TorsoPos.p).magnitude
if (not Locked) then
if (Offset / Distance) < ClosestRatio then
ClosestRatio = (Offset / Distance)
FoundPlayer = true
if TargetPlayer ~= Target then
script.Parent.Locking:Play()
TargetPlayer = Target
M.Icon = TargetIcon
AimGUI.Enabled = true
LockGUI.Enabled = false
AimGUI.Adornee = TargetPlayer
LockGUI.Adornee = nil
if (not FoundPlayer) then
script.Parent.Locking:Stop()
end
end
end