## 4 Operationalization of the XR Framework for Safety Management
### Implementation Examples
#### 4.1.12. Workers (Roles and Bots)  
The deployment of activities, risks and work dynamics can be realised differently within virtual environments. Depending on the objective (training, design, planning), these can be included as programming aspects at the time of the 'virtual walkthrough' or as aspects that define the behaviour of virtual workers or first-person users. There, the creation and development of these components should consider aspects such as graphical and animation realism, behaviour, cause-consequence relationships and interactions between bots and users, among others. Figure 21 illustrates the integration of a virtual worker (bot) into the Unity 3D environment to simulate construction site activities. The character model and its animations were sourced from Mixamo, a widely used platform that provides rigged 3D characters and motion sequences. In this case, the bot represents a construction worker performing specific tasks. Once imported into Unity, these animations can be triggered and controlled through scripts or timeline-based logic to simulate realistic work routines. The Inspector window in Unity allows for adjusting animation controllers, movement patterns, and interaction triggers, enabling a detailed and behaviour-driven simulation. These bots are essential for representing human activity in XR training scenarios, especially for simulating unsafe behaviours, risk exposure, or interactions with machinery and users in immersive walkthroughs.  
Figure 22 shows the integration of construction machinery into the XR environment, specifically demonstrating how predefined movement paths can be programmed in Unity to simulate the operation of vehicles or equipment within the site. This allows for the  
observation and analysis of how users--whether real participants or bots--respond to dynamic elements such as moving cranes, trucks, or lifting equipment. Such simulations are valuable for evaluating user behaviour, identifying potential safety conflicts, and testing alternative spatial configurations or safety protocols. Figure 23 extends this by illustrating the interaction between virtual workers (bots) and machinery. In this setup, both individual and coordinated behaviours are programmed to simulate real worksite dynamics, such as proximity interactions, avoidance, or simultaneous tasks. These interactions are configured through Unity's Animator and NavMesh systems, allowing the simulation of realistic workflows and possible risk scenarios.  
Together, these figures demonstrate how immersive environments can be used not only for visualisation, but also for behavioural simulation and risk prediction, providing a testing ground for proactive safety strategies and collaborative task planning in digitally modelled construction sites.  
Thus, it is possible to recreate the real behaviours of workers and machinery in working environments. However, an even more relevant element is interactions with other workers (a key aspect in safety management). Figure 24 shows the interaction between a main user  
Figure 21: Example of bot implementation in XR environment.  
Figure 22: Example of integration of machinery in the XR environment.  
and a bot. Conversations, behavioural changes and indications, among other dynamics, can be established to study the worker's behaviour and educate them about safety.  
On the other hand, multi-user simulations can be recreated so that different workers interact in XR environments, allowing the study and analysis of collective behaviour. This aspect is relevant since collective responsibility in safety issues is a key aspect. The human factor, and the consequences of its actions, can be formed in the virtual environment, with implications for other virtual bots or other \"real players\".