-
Notifications
You must be signed in to change notification settings - Fork 1
Function Details
Pull apart to figure how we switch enemies
function GetRandomEnemyPos(aiBrain)
for k, v in ArmyBrains do if IsEnemy(aiBrain:GetArmyIndex(), v:GetArmyIndex()) and not v:IsDefeated() then if v:GetArmyStartPos() then local ePos = v:GetArmyStartPos() return ePos[1], ePos[3] end end end return false
end
-- Start and end positions local startPos = Vector3(1, 2, 3) local endPos = Vector3(4, 5, 6)
-- Distance to travel local distance = 10
-- Calculate the direction vector local dir = (endPos - startPos):normalized()
-- Calculate the interpolated position local pos = endPos - dir * distance
-- Output the interpolated position print("Interpolated position: ", pos)
-- Start and end positions local startPos = Vector3(1, 2, 3) local endPos = Vector3(4, 5, 6)
-- Distance to travel local distance = 10
-- Calculate the direction vector local dir = (endPos - startPos):normalized()
-- Calculate the interpolated position local pos = startPos + dir * distance
-- Output the interpolated position print("Interpolated position: ", pos)
why is chatgpt so smart!