VR Tutorial

A comprehensive guide on how you can start developing VR applications for Meta Quest VR devices

Rigidbody

The Rigidbody component in Unity empowers GameObjects to realistically respond to forces, gravity, and collisions, serving as a crucial element for crafting dynamic and interactive scenes. Complex physics usually needs to be implemented through scripting with help from the Unity API. While intricate physics can be scripted using Unity's API, simple adjustments can be in the Unity Editor's Inspector window, which we will explain below. For a full reference to how the Rigidbody component can be used with Unity scripting, please refer to the documentation found here: Rigidbody.

  • Mass: Determines how heavy an object is in the physicals simulation. Heavier objects require more force to accelerate or decelerate
  • Drag: Force opposing the object's motion through the air. Simulates air resistance. Higher drag values will slow down the object faster
  • Angular Drag: Similar to Drag but for rotational motion. Simulates rotational air resistance. Higher values will make the object stop rotating faster
  • Gravity: Determines whether the object is affected by gravity or not. When unchecked, the object will remain unaffected by gravity
  • Is Kinematic: If checked, the object will not be affected by forces or collisions. It's moved only by its Transform component, not by the physics engine. We will explain the Transform component in the next section.
  • Interpolate: Used to smooth out the movement of objects, especially when their positions are updated frequently. This is a drop menu with Options: None, Interpolate, Extrapolate
  • Collision Detection: Determines the level of collision detection used for the Rigidbody. This is set to Discrete by default, however other options include: Continuous, and Continuous Dynamic.

Transform

In Unity the Transform component is a fundamental component attached to every GameObject. It represents the position, rotation, and scale of an object in the 3D space. You can manipulate the Transform of a GameObject through 3 ways: the Scene View, the Inspector window, and through scripting. In the Inspector window you should be able to see that every GameObject has a Transform. More information on transform can be found in the Unity manual found here: Transform. The images in this section are also directly from the Unity manual.

The Transform component

 

In Unity, you can manipulate Transforms through the scene view, on the x-axis, y-axis, and z-axis represent by red, green and blue respectively.

A Transform showing the color-coding of the axes

 

When you select a GameObject through the Scene view, you can use the Move, Rotate, and Scale tools to modify the Transforms.

The Hand, Move, Rotate, and Scale tools

 

The appearance of the tool Gizmo, will then differ depending on what tool you selected.

The transform Gizmo with keyboard shortcuts in brackets.

 

For reference, you can see that in our application, our petri dishes representing the compound have Transform components.

 

It is possible to manipulate the Transform through script to create movement, rotation, and scaling effects. This can be achieved by using the Transform API through Unity's API.