How to create your own controllers for Mixed Reality ToolKit ๐ŸŽฎ๐Ÿค“

If you have tried the latest version of Mixed Reality Toolkit (MRTK) you might be asking yourself, how can you change the default Gizmos controllers? The original idea from MRTK is to obtain the default controllers with each of the SDK that we export to our projects, but due to the incompatibility at the time to deserialize with NewtonSoft in projects compilated in IL2CPP, this functionality is being delayed. In this version, if we export to UWP, we can see the controllers, but without any type of animation.

 

The good news is that we can replace those default gizmos for any other model we want, even better, create our own controllers from zero for our games.

 

Letโ€™s begin with a base project from MRTK, you can download the latest version here.

 

Create a news scene and save it.

 

 

The next step is to set up our scene to work in Mixed Reality

 

 

Select the configuration by default and copy it so we can adapt it to our needs. First, we click on copy & paste, then we click on clone and save it.

 

 

Select the input tab and clone the general input profile. Finally, the display.

 

 

The configurable objects system is a little tricky in this version of MRTK, but the object is โ€œbreakโ€ the least possible inside the Toolkit and just modify what we need.

Letโ€™s do it! We will create an empty GameObject and rename it to be our right controller.

 

 

Add the component โ€œMixed Reality Controller Visualizerโ€ and change the ownership to the right controller.

We do the same for the controller in the left hand.

 

 

Functionally speaking the controllers are already created. Now, letโ€™s add something visual, for this example Iโ€™ve downloaded a free asset from the Unity Store, that will allow us easily to distinguish the left hand from the right hand.

 

 

When we finish importing the asset, we drag the sword inside the GameObject. MyRightController and the shield inside of MyLeftController. If itโ€™s for lefthanded people, just change the shield for the sword.

 

 

Since the sword pivot is centered and we want it to be in the sword handle, letโ€™s displace it into the Y axis 0.6

 

 

We need prefabs, no GameObjects in the scene, so we will drag both into a folder, to generate the prefabs and be able to work in these.

 

 

Once created the prefabs, we can delete the GameObejects from the scene and assign them to our profile to replace the default controllers.

 

 

Now letโ€™s do some adjustments to the prefabs of the controllers to be correctly seen, in size, position or rotation. If you have included the same sword and shield of my example, you can do the next adjusts if not you will have to do it by your own.

Letโ€™s start by the shield, we double click to the prefab of MyLeftController and inside the prefab, we select GameObject of Shield_Desktop, the size Iโ€™ve changed it to 0.4 in all the axis and the rotation to 90 for the X axis.

 

 

Now letโ€™s go with the sword, we double click on MyRightController and change the properties from GameObjectSword_Desktop: the size in the shield to 0.4 in all the axis, the rotation 180,90,90 and the position, Iโ€™ve changed it the one we put at the beginning to adjust it to the size in 0, 0, 0.2

 

 

Now letโ€™s get into the fun part, try it!

 

 

Another examples pf controllers inside the project, in this case the 3D modeler has done it with the right coordinates, and it wasnโ€™t necessary to change the size.

 

 

This a basic tutorial of how to create a simple personalized controller. We can create a more complicated one, capture the controller and associate it to animations or any effect we want from the 3D model to create our own controller functioning correctly in all the platform.

 

You can download the project here.

 

Written by: Marcos Rodriguez part of Idiwork’s team

Step by step

Idiwork has arrived and we invite you to join us!
Raspberry Pi4 – All of a sudden!
Experiment #101 How to set up an IoT device in Azure IoT Hub
Start your own video game with Unity3D and CreatorKits
Experiment #101 How To Create a Blockchain Workbench App
XR World: Minecraft Earth
Experiment #101 Architectural Diagram
Cyberpunk 2077 and The Future
Experiment #101 How to create an Azure Function App to record telemetry readings
An Introduction to neural networks
Microsoft Mixer, streaming your life !
Introduction to Azure Notebooks applying Cognitive Services with Jupyter
AR [T] Walk
Return of Age of Empires
Idiwork and Uno Platform partnership!!
The differences between Augemented Reality, Mixed Reality and Virtual Reality !
Experiment #102 How to Create an Azure Notebooks Project and Deploy a Summarization Service
Uno Platform Conference
YouTube Video: Creator Kits, learn how to create a RPG with Unity3D !! ๐Ÿค–
Experiment #102 How to construct and train a Deep Neural Network using Keras and deploy the model as an Azure Web Service ๐Ÿง โ˜๏ธ
Uno Platform Conference Recap ๐Ÿ˜Ž
How to create a Uno Platform project in Visual Studio ๐Ÿ’ป๐Ÿค“
What is a Neural Network? by Alberto Pinedo ๐Ÿง ๐Ÿ’ป
Experiment #102 How to Deploy and Integrate Azure Cognitive Services: Computer Vision and Text Analytics ๐Ÿ’ป๐Ÿ“‘
Next stop: Madrid Games Week ๐Ÿ‘‰๐Ÿค–
Our Madrid Games Week experience ! ๐Ÿ˜Ž๐Ÿค–
Experiment #102 How to use Microsoft Flow to send an email when an event occurs ๐Ÿ“ง๐Ÿ“Œ
Experiment #102 Architectural Diagram ๐Ÿ“
The magic of Hytale โš”๏ธ
Start programming your own app in Uno Platform ๐Ÿ“ฒ๐Ÿ‘จโ€๐Ÿ’ป
Avalonia, a big candidate to create cross-platform apps with XAML ๐Ÿ˜Ž๐Ÿ“ฒ
The value of Blockchain for business by Pablo Junco โ›“๏ธ๐Ÿข
Living in the night: Bloodlines 2 ๐Ÿง›๐ŸŽฎ
Uno Platform Workshop Recap ๐Ÿ’ป๐Ÿ“Œ
EasyRPC. Be proud of your APIs (First Part) ๐Ÿค“๐Ÿš€
Paralives, reimagine your virtual life ๐Ÿ‘พ๐Ÿ‘ฉโ€๐Ÿ’ป
Experiment #103 How to Modify the Project to Work with Face Cognitive Service and Servo Motor ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ“™
Experiment #103 How to Set Up the IoT Device Hardware: Peripherals and Electronics ๐Ÿ”ˆ๐Ÿ’ก
We are going to be in the GDG DevFest in Mรกlaga! ๐Ÿ˜Ž๐Ÿ‘พ
EasyRPC. Be proud of your APIs (Second Part) ๐Ÿค“๐Ÿš€
Experiment #103 How to Build a 3D Printed Box to Pack and Run the IoT Project ๐Ÿš€
MediEvil, remember the fear๐Ÿ’€
Never forget the Fallen Order ๐Ÿน๐ŸŽฎ
Experiment #103 Architectural Diagram ๐Ÿ“
Grace: The perfect DI IoC container [part 1] ๐Ÿ’ป๐Ÿค“
Death Stranding: a story of death and connection โ˜ ๐Ÿน
Experiment #204 How to assembly the 3D printed parts and servo motors of the robotic arm ๐Ÿฆพ๐Ÿค–
TemTem: a dream come true ๐Ÿน๐Ÿ’ฅ
Grace: The perfect DI IoC container [part 2] ๐Ÿ’ป๐Ÿค“
Exploring the Outer Worlds ๐ŸŽ‡โš”
Our review from Hololens 2 ๐Ÿ‘“๐Ÿ‘ท
Learn to code on your iPhone for FREE ๐Ÿ“ฒ๐Ÿš€
New life, new horizons in Animal Crossing ๐ŸŽฎ๐Ÿฑ
Whatโ€™s WinUI? ๐Ÿ’ป๐Ÿš€
Half Life Alyx โ˜ ๐ŸงŸโ€โ™‚
How to deploy a Censorship Resistant Website for FREE ๐Ÿ”“๐ŸŒŽ
Superpower: The parser combinator library [Part 1] ๐Ÿ’ป๐Ÿค“
UnoPlatform and WinUI, what to expect? ๐Ÿš€๐Ÿ“ฒ
Happiness begins in Stardew Valley ๐ŸŽ๐Ÿ“
Science fiction in Assassinโ€™s Creed ๐Ÿ‘ฝ
The Cyber Attack Lifecycle ๐Ÿ•ตโ€โ™€๐Ÿ’ป
Superpower: The parser combinator library [Part 2] ๐Ÿ’ป๐Ÿค“
Learn more about UnoPlatform! ๐Ÿ˜œ๐Ÿ“ข
Create cybernetically enhanced web apps with SvelteJS ๐Ÿ’ป๐Ÿ‘‡
Six Fun Drag & Drop ๐Ÿงฉ Programming Languages To Learn How To Code! ๐Ÿ’ป
Riot and Hytale unite! ๐Ÿ‘พ๐Ÿ˜‰
A new home called EVE Online ๐Ÿ‘ฝ๐Ÿ‘‡
Rejoice with UnoPlatform! May 2020 ๐Ÿ“ฒ๐Ÿ‘‡
UnoPlatform arrives to macOS ๐Ÿ’ป๐Ÿ‘ˆ
Your new empire in Civilization VI ๐ŸŽฎ๐Ÿน
Play Station 5 is near!
Build and defend your city, this is Manor Lords
Customization, landscape generation and more in Hytale๐Ÿง๐Ÿปโ€โ™€๏ธ๐Ÿง๐Ÿผ
Welcome, MAUI! ๐Ÿ’ฃ๐Ÿ“ฒ
Zombies will be zombies (TLOU2) ๐Ÿ‘ฝ๐ŸงŸโ€โ™‚
Rejoice with UnoPlatform! August 2020 ๐Ÿ“ฒ๐Ÿ‘‡
Final Fantasy Crystal Chronicles is back๐Ÿง๐Ÿปโ€โ™€๏ธโš”๏ธ
Bolt is now free in Unity3D ๐ŸŽฎ
Feel the Flutter! ๐ŸŒ
Microsoft buys ZeniMax Media (including Bethesda!)
Intel and Microsoft team up to empower AI on Edge
Linux and WSL2 - Part 1 Linux and WSL2 – Part 1: How do you run Windows applications on Linux? Or vice versa.
Guide how to Run Windows applications on Linux Linux and WSL2 – Part 2: How do you run Windows applications on Linux? Or vice versa.
Domain-driven design Domain-Driven Design: the elephant in the room
azure object anchors Azure Object Anchors: the third tool
Experiment #205 Step by step 1 Experiment #205 Applied Artificial Intelligence, the real one ๐Ÿค–๐Ÿ“น
AI Assembling the system Experiment #205 Applied Artificial Intelligence – Assembling the system โš™๏ธ๐Ÿฆพ
Redit Conquer all the APIs Refit – Conquer all the APIs
Experiment #205 Applied AI: the Information analysis Experiment #205 Applied Artificial Intelligence – Analysis of the information
Brand Presence step by step 1 Blog Experiment #206 Brand Presence
Experiment #206 Brand Presence - The analysis Experiment #206 Brand Presence – The analysis

Stay up to date!



Leave a comment