Moving a dead bot to its original location

I’m having trouble moving my Rein dummy bot back to his original location after he dies.

Any suggestions for a fix?

Simple teleport, nothing else… Same event Player died…

I attempted that but couldn’t get it working. Lemme try it again.

In doubt use a few wait actions between teleport/respawn/resurrect etc.

1 Like

I finally got it working!!

Took me quite a bit!

Btw… do you have any idea how to make a dummy bot move randomly but not fall off the edge. I’m making a target practice but can’t get the bot moving around unpredictably. Thanks for all your help!

There are multiple ways to do so. One would be to check for this:

distance between(nearest walkable position(add(position of(event player), velocity of(event player))), add(position of(event player), velocity of(event player))) >= 0.5

0.5 is just what came to my mind. You might need a bigger/smaller number here. Experiment a bit. Also, instead of “velocity of(event player)” you could try to use “normalize(velocity of(event player))”.

1 Like

Cool… I’ll try my best to replicate this and test it out.

Would this be in conditions or actions?

The option for Distance Between isn’t in actions.

The space that I’m using is the top of the attacker spawn in Paris.

I’m still a beginner so I’m not too sure what number I would need to replace it with to fit that space.

Conditions, as it only detects a close ledge. What happens then needs to be handled afterwards (actionlist).

You can start with some number (e.g. the 0.5) and let the bot move to a ledge and see if it works. If not, then you need to decrease the number.
If the bot falsely detects a ledge when he walks on a walkable surface you need to increase the number.
You need to find a number that is strict enough to detect an actual ledge and generous enough to allow for some variation in the ground surface.

If you need some inspiration, in this (outdated and flawed) mode I made some wall/ledge detection:

Edit: Oh well, the code is most definitely expired.

Here it is (its huge - opening on your own risk) regel("initialisation") { event { Ongoing - Each Player; Team 1; Slot 0; }
bedingungen
{
	Is Game In Progress == True;
}

aktionen
{
	Set Player Variable(Event Player, A, 0);
	deaktiviert Create Effect(All Players(All Teams), Sphere, Red, Add(Position Of(Players In Slot(1, Team 1)), Throttle Of(Players In Slot(1,
		Team 1))), 0.500, Visible To Position and Radius);
	deaktiviert Create Effect(All Players(All Teams), Sphere, Red, Add(Position Of(Players In Slot(1, Team 1)), Normalize(Velocity Of(
		Players In Slot(1, Team 1)))), 0.500, Visible To Position and Radius);
	deaktiviert Create Effect(All Players(All Teams), Sphere, Blue, Nearest Walkable Position(World Vector Of(Left, Players In Slot(1, Team 1),
		Rotation And Translation)), 0.500, Visible To Position and Radius);
	deaktiviert Create HUD Text(All Players(All Teams), World Vector Of(Left, Players In Slot(1, Team 1), Rotation And Translation), Null, Null,
		Left, 0, White, White, White, Visible To and String, Default Visibility);
	deaktiviert Create HUD Text(All Players(All Teams), Ray Cast Hit Position(Position Of(Players In Slot(1, Team 1)), World Vector Of(Left,
		Players In Slot(1, Team 1), Rotation And Translation), All Players(All Teams), Event Player, True), Null, Null, Left, 0, White,
		White, White, Visible To and String, Default Visibility);
	deaktiviert Create HUD Text(All Players(All Teams), Player Variable(Players In Slot(1, Team 1), W), Null, Null, Left, 0, White, White, White,
		Visible To and String, Default Visibility);
	deaktiviert Create Effect(All Players(All Teams), Sphere, Green, Ray Cast Hit Position(Players In Slot(1, Team 1), World Vector Of(Multiply(
		Left, 1.500), Players In Slot(1, Team 1), Rotation And Translation), Null, Event Player, False), 0.200,
		Visible To Position and Radius);
	deaktiviert Create HUD Text(All Players(All Teams), World Vector Of(Left, Players In Slot(1, Team 1), Rotation And Translation), Null, Null,
		Left, 0, White, White, White, Visible To and String, Default Visibility);
	deaktiviert Create HUD Text(All Players(All Teams), Nearest Walkable Position(World Vector Of(Left, Players In Slot(1, Team 1),
		Rotation And Translation)), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility);
	deaktiviert Create HUD Text(All Players(All Teams), Distance Between(World Vector Of(Left, Players In Slot(1, Team 1),
		Rotation And Translation), Nearest Walkable Position(World Vector Of(Left, Players In Slot(1, Team 1),
		Rotation And Translation))), Null, Null, Left, 0, White, White, White, Visible To and String, Default Visibility);
	deaktiviert Create Effect(All Players(All Teams), Sphere, Green, Ray Cast Hit Position(Add(Position Of(Players In Slot(1, Team 1)), Up),
		World Vector Of(Add(Up, Multiply(Left, 2)), Players In Slot(1, Team 1), Rotation And Translation), Null, Event Player, False),
		0.200, Visible To Position and Radius);
	deaktiviert Create HUD Text(All Players(All Teams), Horizontal Speed Of(Players In Slot(1, Team 1)), Null, Null, Left, 0, White, White, White,
		Visible To and String, Default Visibility);
}

}

regel(“spawn dummy bot”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}

bedingungen
{
	Has Spawned(Event Player) == True;
	Is Moving(Event Player) == True;
	Is In Spawn Room(Event Player) == False;
	Entity Exists(Players In Slot(1, Team 1)) == False;
}

aktionen
{
	Create Dummy Bot(Hero(Ana), Team 1, 1, Position Of(Event Player), Event Player);
	Set Player Variable(Players In Slot(1, Team 1), M, 0);
	Set Player Variable(Players In Slot(1, Team 1), S, Append To Array(Append To Array(Append To Array(Empty Array, Vector(0, 0, 0)),
		Vector(0, 0, 0)), Vector(0, 0, 0)));
	Create Effect(All Players(All Teams), Light Shaft, Blue, Last Of(Player Variable(Players In Slot(1, Team 1), D)), 0.750,
		Visible To Position and Radius);
	Create Effect(All Players(All Teams), Light Shaft, Green, Value In Array(Player Variable(Players In Slot(1, Team 1), S), 0), 0.750,
		Visible To Position and Radius);
	Create Effect(All Players(All Teams), Light Shaft, Red, Value In Array(Player Variable(Players In Slot(1, Team 1), S), 2), 0.750,
		Visible To Position and Radius);
	Create Icon(All Players(All Teams), Last Of(Player Variable(Players In Slot(1, Team 1), D)), Arrow: Down, Visible To and Position,
		Red, True);
}

}

regel(“dummy bot follow”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Has Spawned(Event Player) == True;
	Distance Between(Event Player, Players In Slot(0, Team 1)) >= 4;
	Player Variable(Players In Slot(0, Team 1), A) == 1;
}

aktionen
{
	Start Throttle In Direction(Event Player, Direction Towards(Event Player, Players In Slot(0, Team 1)), 1, To World,
		Replace existing throttle, Direction and Magnitude);
	Start Facing(Players In Slot(1, Team 1), Direction Towards(Players In Slot(1, Team 1), Event Player), 200, To World,
		Direction and Turn Rate);
}

}

regel(“dummy bot unfollow”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Has Spawned(Event Player) == True;
	Distance Between(Event Player, Players In Slot(0, Team 1)) < 2.500;
	Player Variable(Players In Slot(0, Team 1), A) != 2;
}

aktionen
{
	Stop Throttle In Direction(Event Player);
}

}

regel(“toggle bot follow”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}

bedingungen
{
	Is Button Held(Event Player, Interact) == True;
}

aktionen
{
	Skip If(Compare(Player Variable(Event Player, A), ==, 0), 2);
	Set Player Variable(Event Player, A, 0);
	Abort;
	Set Player Variable(Event Player, A, 1);
}

}

regel(“initiate pathfinding”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}

bedingungen
{
	Is Button Held(Event Player, Crouch) == True;
	Is Game In Progress == True;
	Is In Spawn Room(Event Player) == False;
	Player Variable(Event Player, A) != 2;
}

aktionen
{
	Wait(0.250, Ignore Condition);
	Set Player Variable(Event Player, A, 2);
	deaktiviert Set Player Variable(Players In Slot(1, Team 1), D, Position Of(Event Player));
	Set Player Variable(Players In Slot(1, Team 1), D, Empty Array);
	Modify Player Variable(Players In Slot(1, Team 1), D, Append To Array, Position Of(Event Player));
	Start Camera(Event Player, Add(Position Of(Players In Slot(1, Team 1)), Vector(-2.500, 1.500, -1.500)), Eye Position(
		Players In Slot(1, Team 1)), 50);
	Set Player Variable(Players In Slot(1, Team 1), M, 0);
	Stop Facing(Players In Slot(1, Team 1));
	deaktiviert Set Player Variable(Players In Slot(1, Team 1), P, Position Of(Players In Slot(1, Team 1)));
	Set Player Variable(Players In Slot(1, Team 1), P, Empty Array);
	Set Player Variable(Players In Slot(1, Team 1), B, 0);
}

}

regel(“stop pathfinding”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}

bedingungen
{
	Is Button Held(Event Player, Crouch) == True;
	Is Game In Progress == True;
	Is In Spawn Room(Event Player) == False;
	Player Variable(Event Player, A) == 2;
}

aktionen
{
	Wait(0.250, Ignore Condition);
	Stop Throttle In Direction(Players In Slot(1, Team 1));
	Stop Camera(Players In Slot(0, Team 1));
	Set Player Variable(Players In Slot(0, Team 1), A, 0);
}

}

regel(“DB walk towards d”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	Player Variable(Event Player, M) == 0;
	Player Variable(Event Player, W) == 0;
}

aktionen
{
	Small Message(All Players(All Teams), String("Vorwärts", Null, Null, Null));
	deaktiviert Start Throttle In Direction(Event Player, Direction Towards(Event Player, Player Variable(Event Player, D)), 1, To World,
		Replace existing throttle, Direction and Magnitude);
	deaktiviert Set Facing(Event Player, Direction Towards(Event Player, Player Variable(Event Player, D)), To World);
	Start Throttle In Direction(Event Player, Direction Towards(Event Player, Last Of(Player Variable(Event Player, D))), 1, To World,
		Replace existing throttle, Direction and Magnitude);
	Set Facing(Event Player, Direction Towards(Event Player, Last Of(Player Variable(Event Player, D))), To World);
}

}

regel(“DB reach goal”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	Player Variable(Event Player, M) == 0;
	deaktiviert Distance Between(Event Player, Player Variable(Event Player, D)) <= 1;
	Distance Between(Event Player, Last Of(Player Variable(Event Player, D))) <= 1.500;
}

aktionen
{
	Skip If(Compare(Count Of(Player Variable(Event Player, D)), >, 1), 4);
	Stop Throttle In Direction(Event Player);
	Stop Camera(Players In Slot(0, Team 1));
	Set Player Variable(Players In Slot(0, Team 1), A, 0);
	Abort;
	Stop Throttle In Direction(Event Player);
	Modify Player Variable(Event Player, D, Remove From Array By Value, Last Of(Player Variable(Event Player, D)));
	Set Player Variable(Event Player, W, 1);
	Set Player Variable(Event Player, B, 0);
	Set Player Variable(Event Player, P, Empty Array);
}

}

regel(“DB detect obstacle (right)”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	deaktiviert Distance Between(Add(Position Of(Event Player), Normalize(Velocity Of(Event Player))), Nearest Walkable Position(Add(Position Of(
		Event Player), Normalize(Velocity Of(Event Player))))) >= 0.100;
	deaktiviert Distance Between(Add(Position Of(Event Player), Multiply(Normalize(Velocity Of(Event Player)), 1.500)), Nearest Walkable Position(
		Add(Position Of(Event Player), Multiply(Normalize(Velocity Of(Event Player)), 1.500)))) >= 0.200;
	Distance Between(World Vector Of(Forward, Event Player, Rotation And Translation), Nearest Walkable Position(World Vector Of(
		Forward, Event Player, Rotation And Translation))) >= 0.100;
	Player Variable(Event Player, W) == 0;
	Player Variable(Event Player, B) == 0;
}

aktionen
{
	Small Message(All Players(All Teams), String("Rechts", Null, Null, Null));
	Set Facing(Event Player, Right, To Player);
	Start Throttle In Direction(Event Player, Forward, 1, To Player, Replace existing throttle, None);
	Modify Player Variable(Event Player, M, Add, 1);
	Set Player Variable(Event Player, W, 1);
}

}

regel(“DB return after obstacle (right)”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	Distance Between(World Vector Of(Left, Event Player, Rotation And Translation), Nearest Walkable Position(World Vector Of(Left,
		Event Player, Rotation And Translation))) < 0.200;
	Player Variable(Event Player, M) > 0;
	deaktiviert Distance Between(Multiply(World Vector Of(Left, Event Player, Rotation And Translation), 0.500), Nearest Walkable Position(
		Multiply(World Vector Of(Left, Event Player, Rotation And Translation), 0.500))) < 0.100;
	deaktiviert Ray Cast Hit Position(Event Player, World Vector Of(Multiply(Left, 1.500), Event Player, Rotation And Translation), Null,
		Event Player, False) == World Vector Of(Multiply(Left, 1.500), Event Player, Rotation And Translation);
	Player Variable(Event Player, W) == 0;
	deaktiviert Ray Cast Hit Position(Add(Position Of(Event Player), Up), World Vector Of(Add(Up, Multiply(Left, 1.500)), Event Player,
		Rotation And Translation), Null, Event Player, False) == World Vector Of(Multiply(Left, 1.500), Event Player,
		Rotation And Translation);
	Distance Between(Ray Cast Hit Position(Add(Position Of(Event Player), Up), World Vector Of(Add(Up, Multiply(Left, 2)),
		Event Player, Rotation And Translation), Null, Event Player, False), World Vector Of(Add(Up, Multiply(Left, 2)), Event Player,
		Rotation And Translation)) <= 0.200;
	Player Variable(Event Player, B) == 0;
}

aktionen
{
	Small Message(All Players(All Teams), String("Links", Null, Null, Null));
	Set Facing(Event Player, Left, To Player);
	Start Throttle In Direction(Event Player, Forward, 1, To Player, Replace existing throttle, None);
	deaktiviert Modify Player Variable(Event Player, M, Subtract, 1);
	Set Player Variable(Event Player, M, 0);
	Set Player Variable(Event Player, W, 1);
}

}

regel(“DB detect obstacle (left)”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	Distance Between(World Vector Of(Forward, Event Player, Rotation And Translation), Nearest Walkable Position(World Vector Of(
		Forward, Event Player, Rotation And Translation))) >= 0.100;
	Player Variable(Event Player, W) == 0;
	Player Variable(Event Player, B) == 1;
}

aktionen
{
	Small Message(All Players(All Teams), String("Links", Null, Null, Null));
	Set Facing(Event Player, Left, To Player);
	Start Throttle In Direction(Event Player, Forward, 1, To Player, Replace existing throttle, None);
	Modify Player Variable(Event Player, M, Add, 1);
	Set Player Variable(Event Player, W, 1);
}

}

regel(“DB return after obstacle (left)”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	Distance Between(World Vector Of(Right, Event Player, Rotation And Translation), Nearest Walkable Position(World Vector Of(Right,
		Event Player, Rotation And Translation))) < 0.200;
	Player Variable(Event Player, M) > 0;
	Player Variable(Event Player, W) == 0;
	Distance Between(Ray Cast Hit Position(Add(Position Of(Event Player), Up), World Vector Of(Add(Up, Multiply(Right, 2)),
		Event Player, Rotation And Translation), Null, Event Player, False), World Vector Of(Add(Up, Multiply(Right, 2)), Event Player,
		Rotation And Translation)) <= 0.200;
	Player Variable(Event Player, B) == 1;
}

aktionen
{
	Small Message(All Players(All Teams), String("Rechts", Null, Null, Null));
	Set Facing(Event Player, Right, To Player);
	Start Throttle In Direction(Event Player, Forward, 1, To Player, Replace existing throttle, None);
	Set Player Variable(Event Player, M, 0);
	Set Player Variable(Event Player, W, 1);
}

}

regel(“DB wait after turn”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Event Player, W) == 1;
}

aktionen
{
	Set Player Variable(Event Player, W, 2);
	Wait(0.500, Restart When True);
	Set Player Variable(Event Player, W, 0);
}

}

regel(“slow motion after jump”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 0;
}

bedingungen
{
	Is Button Held(Event Player, Jump) == True;
}

aktionen
{
	Wait(0.250, Ignore Condition);
	Skip If(Compare(Player Variable(Event Player, B), ==, 0), 3);
	Set Slow Motion(100);
	Set Player Variable(Event Player, B, 0);
	Abort;
	Set Slow Motion(30);
	Set Player Variable(Event Player, B, 1);
}

}

regel(“DB move backwards when stuck (low speed)”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	Player Variable(Event Player, W) == 0;
	deaktiviert Or(Compare(Horizontal Speed Of(Event Player), <, 1), Is Standing(Event Player)) == True;
	deaktiviert Horizontal Speed Of(Event Player) < 1;
	Or(Compare(Horizontal Speed Of(Event Player), <, 1), Compare(Value In Array(Player Variable(Event Player, Q), 1), ==, 1)) == True;
}

aktionen
{
	Skip If(Compare(Value In Array(Player Variable(Event Player, Q), 1), ==, 1), 1);
	Wait(1, Abort When False);
	Set Player Variable At Index(Event Player, Q, 1, 0);
	Set Player Variable(Event Player, T, Filtered Array(Player Variable(Event Player, P), Compare(Distance Between(
		Current Array Element, Position Of(Event Player)), <=, 0.500)));
	Skip If(Compare(Count Of(Player Variable(Event Player, T)), >=, 2), 2);
	Modify Player Variable(Event Player, P, Append To Array, Position Of(Event Player));
	Skip(3);
	Big Message(All Players(All Teams), String("{0}: {1}", 2, String("Fehler", Null, Null, Null), Null));
	Set Player Variable(Event Player, F, 1);
	Set Player Variable(Event Player, P, Empty Array);
	Small Message(All Players(All Teams), String("Rückwärts", Null, Null, Null));
	Set Facing(Event Player, Add(Backward, Multiply(Left, 0.500)), To Player);
	Start Throttle In Direction(Event Player, Forward, 1, To Player, Replace existing throttle, None);
	Set Player Variable(Players In Slot(0, Team 1), A, 3);
	Set Player Variable(Event Player, W, 1);
	Wait(0.500, Ignore Condition);
	Set Player Variable(Players In Slot(0, Team 1), A, 2);
	Set Player Variable(Event Player, M, 0);
}

}

regel(“DB detect being stuck (no moves)”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
}

aktionen
{
	Wait(5, Abort When False);
	Skip If(Compare(Distance Between(Position Of(Event Player), Value In Array(Player Variable(Event Player, Q), 0)), >, 1), 1);
	Set Player Variable At Index(Event Player, Q, 1, 1);
	Set Player Variable At Index(Event Player, Q, 0, Position Of(Event Player));
	Loop If Condition Is True;
}

}

regel(“DB detect being stuck (circle) method 2”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	Player Variable(Event Player, M) > 0;
}

aktionen
{
	Set Player Variable(Event Player, T, Filtered Array(Player Variable(Event Player, P), Compare(Distance Between(
		Current Array Element, Position Of(Event Player)), <=, 0.500)));
	Skip If(Compare(Count Of(Player Variable(Event Player, T)), >=, 2), 2);
	Modify Player Variable(Event Player, P, Append To Array, Position Of(Event Player));
	Abort;
	Big Message(All Players(All Teams), String("{0}: {1}", 2, String("Fehler", Null, Null, Null), Null));
	Set Player Variable(Event Player, F, 1);
	Set Player Variable(Event Player, P, Empty Array);
}

}

regel(“DB handle being stuck”)
{
event
{
Ongoing - Each Player;
Team 1;
Slot 1;
}

bedingungen
{
	Player Variable(Players In Slot(0, Team 1), A) == 2;
	Player Variable(Event Player, F) == 1;
}

aktionen
{
	Set Player Variable At Index(Event Player, S, 0, Divide(Add(Position Of(Event Player), Last Of(Player Variable(Event Player, D))),
		2));
	Set Player Variable At Index(Event Player, S, 1, Direction Towards(Position Of(Event Player), Last Of(Player Variable(Event Player,
		D))));
	Set Player Variable At Index(Event Player, S, 2, Add(Value In Array(Player Variable(Event Player, S), 0), Multiply(
		Direction Towards(Position Of(Event Player), Vector(1, Add(Y Component Of(Position Of(Event Player)), 0.500), Divide(Multiply(
		-1.000, X Component Of(Value In Array(Player Variable(Event Player, S), 1))), Z Component Of(Value In Array(Player Variable(
		Event Player, S), 1))))), Min(Max(Distance Between(Position Of(Event Player), Last Of(Player Variable(Event Player, D))),
		3.500), 10))));
	Modify Player Variable(Event Player, D, Append To Array, Nearest Walkable Position(Value In Array(Player Variable(Event Player, S),
		2)));
	Set Player Variable(Event Player, F, 0);
	Set Player Variable(Event Player, B, Subtract(1, Player Variable(Event Player, B)));
}

}

1 Like

Actually it isn’t…

Do I have to write all of what your wrote in the drop down menu? Is that meant to be the action? I wrote what you had for the condition.

I really only know basic stuff so I’m just trying to understand how to do stuff.

No, of course not!

So when the condition triggers, you know that there is a ledge (or a wall - it detects walls aswell) in the direction the bot is walking.
What you are letting the bot do next is your decision. You could make him simply stop (stop throttle in direction).
Or you could make him walk in a random direction.
You could also let the bot walk in the opposite direction he is coming from: start throttle in direction(event player, multiply(velocity of(event player), -1), 1, to world, replace existing throttle, none)
Another idea would be to make the bot walk in the opposite direction, then make him go in a random direction:

the action above
wait(2, restart when true)
throttle in random direction

Or any other ideas you have :slight_smile:

1 Like

It’s working pretty well but he’s not detecting the ledge. Lemme trying changing the 0.5.

I went all the way to 15 and he would still walk off the edge. Maybe I’ll just make a teleport.

You need to lower the number. 0.2 or even 0.1 should work better.

1 Like

It still didn’t work…

Lemme just give you a code so you can see what I’m trying to do.

SCSQ1

I tried using what you gave me. I renamed it “RIGHT HERE” in case you want to look at it. I tried 0.2 then 0.1.

You’ll see a green circle with the words “target practice”. This will take you to where the Reinhardt bot is.

Btw… this isn’t my gamemode. I took someone else’s gamemode and was adding to it so I could use it as a warm up before games.

Ok I see why it doesn’t work for you. The bot is in an out-of-bounds area, so the “nearest walkable position” is always very far away, as an out-of-bounds area is not walkable.
I tried another method using ray cast, but it didn’t work aswell. The ray cast went just through the ground without registering it.
The only way I got working is to simply teleport him back when his Y component of his positon is lower than the ground height (around 29.7): JBGTR (I also added a movement in random direction rule to test things).

Actually I can think of another way: To register the area bounds, not the actual ledge: [Help] How can i check mathematical area? - #4 by Shanalotte-21334
But this has not very well performance and its also quite advanced. But you can try to use it if you really want to.

1 Like

Thanks! Your awesome!

1 Like