Demolishing Building using Excavator and 3D UI in VR.

Suleiman Abdullah
3 min readDec 4, 2023

--

Objective: Demolishing Building using an Excavator and 3D UI in VR.

In the first step, I will import the XRI example project and add two levers to the hierarchy.

Expand Lever first< Lever Stick, and set it to -50, add two events to this lever, and Uncheck value.

Select the second Laver < Laver stick, change its x-rotation to -50, then select Laver then change y rotation to 180. add Active event and Deactivate Event.

Note: Disable value on the second Lever

Now drag and drop the Excavator to the event of the first Lever and call the move arm method set a float value to one in Activate and zero to Deactivate Event.

Repeat the above step but in Activate put negative one and zero at Deactivate event.

To move the excavator and turn it, drag and drop the Joystick add two On value change events, and call a dynamic method that responds to player input.

We need to move the cab of the excavator, drag and drop the wheel to the hierarchy add event and call rotate cab. And make sure the value starts at zero when the game starts.

Add the dial in the hierarchy and uncheck the clamped Motion, add one event, and call the Rotate Bucket.

This is how I demolished this building using 3d UI and an excavator.

See you in the next one.

--

--

Suleiman Abdullah

Self taught Unity Developer, who is passion about making games ,and he loves Math For Game Development