Code: Select all
See:
SPOS AABBCCDD 6
{
Vector2 targetPos = target.pos.xy;
if(target != null)
{
self.TryMove(targetPos, 0, false, null);
A_Print("I moved!");
}
}
Goto Missile;
- KiddTheIdiot
Code: Select all
See:
SPOS AABBCCDD 6
{
Vector2 targetPos = target.pos.xy;
if(target != null)
{
self.TryMove(targetPos, 0, false, null);
A_Print("I moved!");
}
}
Goto Missile;
and that's why you cannot achieve this with just this function, for TryMove will directly teleport (if every check passes) the caller to the xy position you specify in its arguments.KiddTheIdiot wrote: ↑Wed Jun 10, 2026 3:17 pm I'm not trying to teleport the monster to the target. I just want him to walk there, which is why I used TryMove.
Code: Select all
vector2 stepToTarget = level.Vec2Diff(pos.xy, target.pos.xy).Unit() * speed;
TryMove(stepToTarget, MaxStepHeight);
Code: Select all
[...]
if(!TryMove(stepToTarget, MaxStepHeight)) A_Chase();