Hi,
I have been trying to get a bot to move to a vector for the last 8 hours, but have failed. Firtly, I tried to make a Mutator
PS: I have tried several different variations of this code, but none seem to work.
where HumanActor is a var class HumanActor;
Then I tried to make my own gametype and overrode the method when a player way called. I was also writing stuff to the log file from there. That way, I know it was being called, but unfortunately, my bots were still not budging.
Another thing that I tried is to call the FindPathTo function and then MoveToward, but when I do this I get a compiler error that says, MoveToward cannot be called here. Does anyone have ANY idea as to how I can move a bot to a vector.
Thanks,
- Sid
I have been trying to get a bot to move to a vector for the last 8 hours, but have failed. Firtly, I tried to make a Mutator
Code:
function Timer()
{
local Controller C;
local Bot b;
local vector R;
R.x = 957;
R.y = -859;
R.z = -947;
for (C = Level.ControllerList; C != None; C = C.NextController)
{
if (C.bIsPlayer)
{
b = Bot(C);
if (b == None)
return;
HumanActor = b.FindPathTo(R);
if (b.ActorReachable(HumanActor))
{
Log (b.Name$" Reachable");
b.RouteGoal = HumanActor;
b.RouteCache[0] = None;
b.GoalString = b$"almost at "$HumanActor;
b.MoveTarget = HumanActor;
b.bFinalStretch = true;
b.SetAttractionState();
}
else
{
Log ("Dest not reachable");
}
}
b.Destination = R;
b.SetAttractionState();
}
}
where HumanActor is a var class HumanActor;
Then I tried to make my own gametype and overrode the method when a player way called. I was also writing stuff to the log file from there. That way, I know it was being called, but unfortunately, my bots were still not budging.
Another thing that I tried is to call the FindPathTo function and then MoveToward, but when I do this I get a compiler error that says, MoveToward cannot be called here. Does anyone have ANY idea as to how I can move a bot to a vector.
Thanks,
- Sid