Hey ich arbeite grade an meiner Zombie KI aber ich habe nicht wirklich ein problem sondern mich stört was.
Die rotation wird meisstens nur halb richtig gemacht und die peds buggen auch ein wenig rum wen sie eine animation dabei machen.
Hier mein code
Lua
function findRotation(x1,y1,x2,y2) -- Useful Function
local t = -math.deg(math.atan2(x2-x1,y2-y1))
if t < 0 then t = t + 360 end;
return t;
end
function setZombieRotation( zombie, zx, zy )
local x, y, _ = getElementPosition( localPlayer );
local angle = findRotation( zx, zy, x, y );
setElementRotation( zombie, 0, 0, angle );
end
Alles anzeigen
Ist jetzt nicht so schlimm aber sieht halt nicht so gut aus.
Weiß nicht ob das jetzt an MTA liegt.