How to Use Physics for Collisions in DOTS XR

This will take you about 20 minutes in prep time if you don't have Unity set-up, and 30 minutes in coding and debug time.

Click Here for DOTS Tutorial

Stop struggling with the limited documentation. Follow this step-by-step tutorial: "How to Use Physics for Collisions in DOTS XR."

Full workflows and code to make collisions that change material and destroy prefab entities using DOTS Physics

Click Here for DOTS Tutorial

This gitbook takes you through step-by-step full workflows and code to make collisions that change material and destroy prefab entities using DOTS Physics. Once you've coded along and fully finished the "How To Use Physics for Collisions" tutorial, you will be able to make collisions that change material and destroy prefab entities using DOTS Physics.

Click Here for DOTS Tutorial

High-Level steps to Use Physics for Collisions:

Number 01

Add the NetCode package and create ClientServerConnectionControl

Number 02

Update IP address and port to be provided by GameObjects

Number 03

Trigger a client server connection through GameObjects with tags

FAQ

How do you make Rigid Bodies using DOTS Physics in DOTS XR?

Since Unity Physics is purely based on DOTS, rigid bodies are represented with component data on the Entities. The simplified Physics Body and Physics Shape view that you have in the Editor is actually composed of multiple data components under the hood at runtime. This allows more efficient access and to save space for static bodies which do not require some of the data.

What are the main run-time components of DOTS Physics in DOTS XR?

The main components are: PhysicsCollider, PhysicsVelocity, PhysicsMass, PhysicsDamping, PhysicsGravityFactor, PhysicsCustomTags. These components are read from to BuildPhysicsWorld then written to in ExportPhysicsWorld.

What are Physics Category Names in DOTS XR?

Physics Category Names are how you can define what objects collide with each other and whether or not they raise events.

Haven’t begun learning Unity DOTS yet, and need to start at the very beginning?

If you haven't yet dipped your toes into learning Unity's new multithreaded Data-Oriented Technology Stack (DOTS), now is the time. You can start at the very beginning with Moetsi’s tutorial, which culminates in your very own deployable sample project. You’ll be guided by full workflows, code-alongs, videos, and GIFs along the way.

Get Started