top of page
Programmation
Les Walkers

Designer la state machine des ennemis communs du jeu.
- Séparation des différentes actions des ennemis.
- Proposition de différents states
- Élaboration d'une structure
- Création d'un schéma
Tout en programmant la state machine des ennemis, je devais m'assurer que les champs dans l'inspecteur de Unity étaient déjà assignés ou sinon clair et simple à utiliser par les level designer.
Une autre partie de mon travail était donc de leur faire un petit cours sur comment bien faire fonctionner les ennemis et leur rédiger une documentation.
Exemples de code

Code Base State Machine
At each change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.

Idle State Code
Switch to state Patrol and stop Idle animation.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.

Patrol State Code
Patrol state allows the Walker to move from waypoint to waypoint.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.

Chase State Code
All Walkers in the same group are in Chase when one of them has shouted.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.

Code Scream State
When the player is detected by a Walker, his state is changed to the Scream state.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.

Code Base State Machine
At each change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.

Idle State Code
Switch to state Patrol and stop Idle animation.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.

Patrol State Code
Patrol state allows the Walker to move from waypoint to waypoint.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.

Chase State Code
All Walkers in the same group are in Chase when one of them has shouted.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.

Code Scream State
When the player is detected by a Walker, his state is changed to the Scream state.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.

Code Base State Machine
At each change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.

Idle State Code
Switch to state Patrol and stop Idle animation.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.

Patrol State Code
Patrol state allows the Walker to move from waypoint to waypoint.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.

Chase State Code
All Walkers in the same group are in Chase when one of them has shouted.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.

Code Scream State
When the player is detected by a Walker, his state is changed to the Scream state.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.

Code Base State Machine
At each change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.

Idle State Code
Switch to state Patrol and stop Idle animation.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.

Patrol State Code
Patrol state allows the Walker to move from waypoint to waypoint.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.

Chase State Code
All Walkers in the same group are in Chase when one of them has shouted.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.

Code Scream State
When the player is detected by a Walker, his state is changed to the Scream state.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.

Code Base State Machine
At each change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.

Idle State Code
Switch to state Patrol and stop Idle animation.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.

Patrol State Code
Patrol state allows the Walker to move from waypoint to waypoint.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.

Chase State Code
All Walkers in the same group are in Chase when one of them has shouted.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.

Code Scream State
When the player is detected by a Walker, his state is changed to the Scream state.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.

Code Base State Machine
At each change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.
-------------------------------------------------- -------------------------------------------------- -------
Every change of state, all coroutines are stopped and the Start() of the new state is called.

Idle State Code
Switch to state Patrol and stop Idle animation.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.
The PlayerSeen() function allows to change the state to Scream if the player is detected and no other Walker in the group has shouted.
-------------------------------------------------- -------------------------------------------------- -------
Change to Patrol state and stopped the Idle animation.
The function PlayerSeen() changes the state for Scream if none of the Walkers in the group has already scream.

Patrol State Code
Patrol state allows the Walker to move from waypoint to waypoint.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.
These waypoints are placed by the level designers in the levels.
-------------------------------------------------- -------------------------------------------------- -------
This state allows the Walkers to move from one waypoint to another. Those waypoints are set in levels by level designers.

Chase State Code
All Walkers in the same group are in Chase when one of them has shouted.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.
They move towards the player and when close enough their state changes to Attack.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker screams, all of the Walkers in his group enter Chase state.
They all head for the player and when they are close enough, they attack.

Code Scream State
When the player is detected by a Walker, his state is changed to the Scream state.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.
The Walker informs his manager that he shouted for the latter to send all the walkers in the group in pursuit of the player.
-------------------------------------------------- -------------------------------------------------- -------
When a Walker detects the player, his state changes to Scream.
The Walker sends the information to his manager.
The manager sends all the Walkers in the group to chase the player.

Les Ingrédients
Les ingrédients sur lesquels j'ai travaillé sont utilisés en grande partie pour les puzzles.
- Vent
- Volets manuels
- Caisses
- Bibliothèques
Pour la programmation des ingrédients, j'ai commencé par réfléchir à la logique que j'allais implémenter.
Après avoir tester les ingrédients dans mon gym et m'assuré qu'ils fonctionnaient bien, j'ai créé des prefabs pour les level designer.
À partir de ce moment, je devais leur montrer comment bien les intégrer dans Unity.
J'attendais ensuite de recevoir leur commentaires et critiques pour apporter les améliorations nécessaires.
Vers la fin de la production nous étions en phase de polish donc je reprenais les ingrédients un par un et les amenais vers leur version finale.
Exemples de code

Vent ingredient code
Since the wind is placed by the level designers in their levels, the Header is useful to tell them what to do.
The variables are ordered with clear names for ease of reading the code.
The variables are ordered with clear names for ease of reading the code.

Ingredient code Vent continued
I implemented the wind so that at the time of the Start(), a box collider is created. The latter begins at the window and ends at the first wall it touches.
In his FixedUpdate(), if the switchoff variable becomes true his VFX is disabled to indicate that the wind has been blocked.
In his FixedUpdate(), if the switchoff variable becomes true his VFX is disabled to indicate that the wind has been blocked.

Ingredient code Vent continued
When an element that can interact with the wind enters its box collider, several results are possible.
- The torch is extinguished
- Manual flaps block the wind (switchoff becomes true)
- Ice blocks block the wind (switchoff becomes true)
- Libraries block wind (switchoff becomes true)
There is also the opposite of possible. When an object that can block the wind is no longer in the boxcollider, the wind returns.
- The torch is extinguished
- Manual flaps block the wind (switchoff becomes true)
- Ice blocks block the wind (switchoff becomes true)
- Libraries block wind (switchoff becomes true)
There is also the opposite of possible. When an object that can block the wind is no longer in the boxcollider, the wind returns.

Inspector for level designers
When creating the wind prefab, I made sure that all the inspector fields were properly assigned.
The header and variable names make it easy to understand.
The header and variable names make it easy to understand.

Ingredient code Section
A very simple code that allows you to close shutters to block the wind.
A timer is started to allow the shutters to open again.
A timer is started to allow the shutters to open again.

Ingredient code Library
This code allows you to move a bookcase in 4 directions.

Ingredient code Library continued
Here, for example, is the code for moving forward.
A raycast is used to check if there is an object in the path or not.
If there is no object in the path, then the bookcase can move 1m15 (one full move).
On the other hand, if there is an object in the path, the movement will be shorter to ensure that the library does not fit inside.
A raycast is used to check if there is an object in the path or not.
If there is no object in the path, then the bookcase can move 1m15 (one full move).
On the other hand, if there is an object in the path, the movement will be shorter to ensure that the library does not fit inside.

Ingredient code Library continued
The same here but the code is adapted for moving to the right.

Vent ingredient code
Since the wind is placed by the level designers in their levels, the Header is useful to tell them what to do.
The variables are ordered with clear names for ease of reading the code.
The variables are ordered with clear names for ease of reading the code.

Ingredient code Vent continued
I implemented the wind so that at the time of the Start(), a box collider is created. The latter begins at the window and ends at the first wall it touches.
In his FixedUpdate(), if the switchoff variable becomes true his VFX is disabled to indicate that the wind has been blocked.
In his FixedUpdate(), if the switchoff variable becomes true his VFX is disabled to indicate that the wind has been blocked.

Ingredient code Vent continued
When an element that can interact with the wind enters its box collider, several results are possible.
- The torch is extinguished
- Manual flaps block the wind (switchoff becomes true)
- Ice blocks block the wind (switchoff becomes true)
- Libraries block wind (switchoff becomes true)
There is also the opposite of possible. When an object that can block the wind is no longer in the boxcollider, the wind returns.
- The torch is extinguished
- Manual flaps block the wind (switchoff becomes true)
- Ice blocks block the wind (switchoff becomes true)
- Libraries block wind (switchoff becomes true)
There is also the opposite of possible. When an object that can block the wind is no longer in the boxcollider, the wind returns.

Inspector for level designers
When creating the wind prefab, I made sure that all the inspector fields were properly assigned.
The header and variable names make it easy to understand.
The header and variable names make it easy to understand.

Ingredient code Section
A very simple code that allows you to close shutters to block the wind.
A timer is started to allow the shutters to open again.
A timer is started to allow the shutters to open again.

Ingredient code Library
This code allows you to move a bookcase in 4 directions.

Ingredient code Library continued
Here, for example, is the code for moving forward.
A raycast is used to check if there is an object in the path or not.
If there is no object in the path, then the bookcase can move 1m15 (one full move).
On the other hand, if there is an object in the path, the movement will be shorter to ensure that the library does not fit inside.
A raycast is used to check if there is an object in the path or not.
If there is no object in the path, then the bookcase can move 1m15 (one full move).
On the other hand, if there is an object in the path, the movement will be shorter to ensure that the library does not fit inside.

Ingredient code Library continued
The same here but the code is adapted for moving to the right.

Vent ingredient code
Since the wind is placed by the level designers in their levels, the Header is useful to tell them what to do.
The variables are ordered with clear names for ease of reading the code.
The variables are ordered with clear names for ease of reading the code.

Ingredient code Vent continued
I implemented the wind so that at the time of the Start(), a box collider is created. The latter begins at the window and ends at the first wall it touches.
In his FixedUpdate(), if the switchoff variable becomes true his VFX is disabled to indicate that the wind has been blocked.
In his FixedUpdate(), if the switchoff variable becomes true his VFX is disabled to indicate that the wind has been blocked.

Ingredient code Vent continued
When an element that can interact with the wind enters its box collider, several results are possible.
- The torch is extinguished
- Manual flaps block the wind (switchoff becomes true)
- Ice blocks block the wind (switchoff becomes true)
- Libraries block wind (switchoff becomes true)
There is also the opposite of possible. When an object that can block the wind is no longer in the boxcollider, the wind returns.
- The torch is extinguished
- Manual flaps block the wind (switchoff becomes true)
- Ice blocks block the wind (switchoff becomes true)
- Libraries block wind (switchoff becomes true)
There is also the opposite of possible. When an object that can block the wind is no longer in the boxcollider, the wind returns.

Inspector for level designers
When creating the wind prefab, I made sure that all the inspector fields were properly assigned.
The header and variable names make it easy to understand.
The header and variable names make it easy to understand.

Ingredient code Section
A very simple code that allows you to close shutters to block the wind.
A timer is started to allow the shutters to open again.
A timer is started to allow the shutters to open again.

Ingredient code Library
This code allows you to move a bookcase in 4 directions.

Ingredient code Library continued
Here, for example, is the code for moving forward.
A raycast is used to check if there is an object in the path or not.
If there is no object in the path, then the bookcase can move 1m15 (one full move).
On the other hand, if there is an object in the path, the movement will be shorter to ensure that the library does not fit inside.
A raycast is used to check if there is an object in the path or not.
If there is no object in the path, then the bookcase can move 1m15 (one full move).
On the other hand, if there is an object in the path, the movement will be shorter to ensure that the library does not fit inside.

Ingredient code Library continued
The same here but the code is adapted for moving to the right.

Vent ingredient code
Since the wind is placed by the level designers in their levels, the Header is useful to tell them what to do.
The variables are ordered with clear names for ease of reading the code.
The variables are ordered with clear names for ease of reading the code.

Ingredient code Vent continued
I implemented the wind so that at the time of the Start(), a box collider is created. The latter begins at the window and ends at the first wall it touches.
In his FixedUpdate(), if the switchoff variable becomes true his VFX is disabled to indicate that the wind has been blocked.
In his FixedUpdate(), if the switchoff variable becomes true his VFX is disabled to indicate that the wind has been blocked.

Ingredient code Vent continued
When an element that can interact with the wind enters its box collider, several results are possible.
- The torch is extinguished
- Manual flaps block the wind (switchoff becomes true)
- Ice blocks block the wind (switchoff becomes true)
- Libraries block wind (switchoff becomes true)
There is also the opposite of possible. When an object that can block the wind is no longer in the boxcollider, the wind returns.
- The torch is extinguished
- Manual flaps block the wind (switchoff becomes true)
- Ice blocks block the wind (switchoff becomes true)
- Libraries block wind (switchoff becomes true)
There is also the opposite of possible. When an object that can block the wind is no longer in the boxcollider, the wind returns.

Inspector for level designers
When creating the wind prefab, I made sure that all the inspector fields were properly assigned.
The header and variable names make it easy to understand.
The header and variable names make it easy to understand.

Ingredient code Section
A very simple code that allows you to close shutters to block the wind.
A timer is started to allow the shutters to open again.
A timer is started to allow the shutters to open again.

Ingredient code Library
This code allows you to move a bookcase in 4 directions.

Ingredient code Library continued
Here, for example, is the code for moving forward.
A raycast is used to check if there is an object in the path or not.
If there is no object in the path, then the bookcase can move 1m15 (one full move).
On the other hand, if there is an object in the path, the movement will be shorter to ensure that the library does not fit inside.
A raycast is used to check if there is an object in the path or not.
If there is no object in the path, then the bookcase can move 1m15 (one full move).
On the other hand, if there is an object in the path, the movement will be shorter to ensure that the library does not fit inside.

Ingredient code Library continued
The same here but the code is adapted for moving to the right.
bottom of page