how can i make the bots doesn’t hit with the wall (or fallen)
You can use ray cast to check if the bot is heading straight into a wall and ray cast normal to change the angle
rule("Don't hit walls")
{
event
{
Ongoing - Each Player;
All;
All;
}
conditions
{
Ray Cast Hit Position(Event Player, Add(Eye Position(Event Player), Divide(Velocity Of(Event Player), 8)), Empty Array,
Empty Array, False) != Add(Eye Position(Event Player), Divide(Velocity Of(Event Player), 8));
Is Dummy Bot(Event Player) == True;
}
actions
{
Set Facing(Event Player, Ray Cast Hit Normal(Eye Position(Event Player), Add(Eye Position(Event Player), Divide(Velocity Of(
Event Player), 8)), Empty Array, Empty Array, False), To World);
}
}
2 Likes
ty for the help but this doesn’t work for me