This page looks best with JavaScript enabled

Attacking the Shield Shader - Lets Make an Energy Shield - Part 4

 ·   ·  ☕ 1 min read

We have a shield shader, but how do we get it to interact with the world. More plainly: how can we shoot our shield? Today we’re going to make that possible.

We’ll use raycasts to build projects and also take advantage of Unity’s SendMessage function to invoke messages on the impacted elements. A simple way to send information about our projectile to the objects we hit with it. We’ll also take advantage of Unity’s WorldToLocalMatrix to transform the impact point into object space positions that have the correct rotation, scale and translation for drawing.

The end result? A shield that we can shoot no matter it’s rotation, scale or location and get an accurate simulation.


Sam Wronski
Sam Wronski
Maker of things and professional software engineer. Lets make something awesome together!