Unity Change Color of Material

This week I have a super quick tip for you. If you need to change the color of an object in Unity, it is pretty straight forward.

First you need to get a reference to the object’s Renderer component. A good place to do this may be in the Start method:

Renderer rend;

// Use this for initialization
void Start () {
  rend = GetComponent<Renderer>();
}

Then inside of the Update method, you could change the the color (like when the Mouse button was just pressed):

void Update () {

  if (Input.GetButtonUp("Fire1"))
  {
    rend.material.SetColor("_Color", Random.ColorHSV());
  }

}

That really is all there is to it. If you want a little more information on why the magic string of _Color is used, make sure to check out the video this week:

HoloLens 2018 – It’s 2 Years Old!

Every single week for two years, I’ve produced content around mixed reality and the majority of the content has been on the HoloLens itself.

I decided to go through the archives and make a video of all the different demos, apps, and games I’ve created (or played) over the last 2 years.

Also, Microsoft is has released the Windows 10 RS4 Preview for the HoloLens.
https://blogs.msdn.microsoft.com/uk_faculty_connection/2018/03/29/windows-10-rs4-preview-for-hololens-and-onnx-offline-machine-learning/

Watch the HoloLens 2018 compilation video here:

HoloLens Unboxing and Authentic First Impressions
https://youtu.be/ULaH_f1yWlM

Top 5 Apps in the HoloLens Store on Day 1
https://youtu.be/n4GDo4_sxy8

How to Record using your HoloLens TWO different ways
https://youtu.be/lDKbFaY_6KA

How to deploy an app to the HoloLens Device
https://youtu.be/i4OWDfx_w0M

How to Deploy an Unity App to the HoloLens Device – Step by Step
https://youtu.be/d0qOrq8zbwI

How Does the HoloLens Look Outside
https://youtu.be/vUg12jxeU90

HoloLens HoloTour: A Deeper Look
https://youtu.be/7GCv7TTAPTs

Tunnel Vision on HoloLens
https://youtu.be/Xi2-at53Kc8

Hanging with Holograms (HoloLens)
https://youtu.be/ZY2ukQXqMD0

Pratical HoloLens: Lubricating a Mower
https://youtu.be/EW5AR-vL_kc

HoloLens Bouncing Ball
https://youtu.be/OKB7KENOZYs

HoloLens Fireworks! Happy 4th of July!!
https://youtu.be/XWETVfyEYLk

HoloLens Developer Challenge: Wizard Battle (Mage)
https://youtu.be/ntwhM9FrSzY

HoloLens Developer Challenge: Wizard Battle (Sorcerer)
https://youtu.be/ntwhM9FrSzY

HoloLens Bed Demo
https://youtu.be/rpZvP6Mq1js

HoloLens Magic Window Demo
https://youtu.be/uevunxV3hY0

Holographic Remoting Player app
https://youtu.be/te8eJmD1_0w

HoloLens RC Racer “HoloWheels” Demo
https://youtu.be/M_nSOiVbUVc

HoloLens Actiongram
https://youtu.be/5aNvR0EXN6c

Spatial Understanding working on the HoloLens Emulator
https://youtu.be/5aNvR0EXN6c

Updated Visualizer
https://youtu.be/i8CBw-3ytiQ

Merry Holographic Christmas
https://youtu.be/NBpBICRTogw  — /yt

Holographic Bouncing Ball Tutorial Part 4
https://youtu.be/Zo152_Yl1XE

HoloValentine App – Source Code Available
https://youtu.be/EeMj8ZrVGBM

HoloLens Spatial Understanding in the Unity Editor
https://youtu.be/jy8XHQAFyU0

Little Holographic Dragon on the HoloLens
https://youtu.be/cxvTunDcvTk

Medieval VR on the HoloLens
https://youtu.be/tBO0P7ye85U

Fun with HoloLems Lemmings
https://youtu.be/vluX8rrWlNY

HoloLens Particles
https://youtu.be/uIjbIicG-zs

HoloLens Paintball aka HoloPaintball
https://youtu.be/cJHZmZJG0ac

Dynamically Placed Items with Spatial Understanding
https://youtu.be/9yLOKts7Sd4

Hiding Objects in Unity with HoloToolkit Input Manager
https://youtu.be/AkHADROaefA

How to Deploy to the HoloLens from Unity
https://youtu.be/oQvBX2GQ5zQ

HoloLens Meme Fun #IAmAHoloLensDev
https://youtu.be/JsgOk_XE6vQ

HoloPaintBall Source Code
https://youtu.be/CtV6k9eF1dI

Ocean Treasure on the HoloLens played with my kids
https://youtu.be/kRXS8LpNDxI

Paint 3D, Unity and the HoloLens
https://youtu.be/hvYcgV02cgc

Learn HoloLens Live Q&A – Spatial Understanding and World Anchors
https://youtu.be/G0P4jhcglkg

Unity Hub

This week I spend a little bit of time talking about how much I like the Unity Hub. It allows you to easily install new versions, uninstall old versions, quickly install or uninstall components and quickly open solutions with a specific build target.

You can download it here:

http://chd.me/unityhub

Check the video:

Hill Valley VR – Windows Mixed Reality via Edge – Back to the Future

Last week, I mentioned the Universal GameDev Challenge presented from Microsoft, Unity, Intel and Universal Studios. Like I mentioned last week, the Back to the Future intellectual property that can be used in the contest really got my attention.

It reminded me about a 3D experience I was able to have a peek into Hill Valley through a web browser. I saw it about the time that WebGL was coming out.

Well, I started digging into WebGL and WebVR a little bit and came across the demo on the Babylon.js site.

You can watch this week’s video where I show Hill Valley VR running through Edge on the Windows Mixed Reality device.

I mention it in the video, but I’ll say it here as well… The contest is for Windows 10 Universal games, not for WebVR. I just didn’t want there to be any confusion. It is the Universal GameDev challenge because it is running as a Universal Windows app and you get to utilize Universal Studio’s IP… see what they did there?

Enjoy the video!