Blockland Forums > Modification Help
(Solved?) Setting player pitch (AIConnection setMove speed/units question)
YayFun:
Is this what you are looking for? AI right?
--- Code: ---function LookAtPlayer(%Player, %Bot)
{
if(!isObject(%Player))
return;
if(!isObject(%Bot))
return;
%y = getWord(%Player.getDataBlock().boundingBox, 1);
%pos = getWords(%Player.getTransform(), 0, 2);
%oldPos = %pos;
%vec = "0 -4 0";
%vec = MatrixMulVector(%Player.getTransform(), %vec);
%pos = "0 0 0";
%pos = VectorAdd(%oldPos, VectorScale(%vec, %y));
%followPos = %pos;
%pos = getWords(%Bot.getTransform(), 0, 2);
%vec = VectorSub(%followPos, %pos);
%len = VectorLen(%vec);
%Bot.setAimLocation(%followPos);
}
--- End code ---
Chrono:
That would require the player to be an AiPlayer.
He wants an AiConnection to control a normal Player for a moment, and look a certain amount of degrees.
Lugnut:
Why is it not possible to just set which angle you're looking?
It seems kinda dumb to not have a default function for that.