Unity Junior Programmer Mission: Create With code Challenge 2 – Program a dog to play fetch

My custom Unity development layout

I used array and random number generation skills to program this challenge where balls are randomly falling from the sky and you have to send your dog out to catch them before they hit the ground. To complete this challenge, I was required to make sure the variables are assigned properly, the if-statements are programmed correctly, the collisions are being detected perfectly, and that objects are being generated randomly.

Give the game a try in your browser at https://meta.dwdenney.com/challenge2/

Continue reading Unity Junior Programmer Mission: Create With code Challenge 2 – Program a dog to play fetch

Unity Junior Programmer Mission: Create With code Unit 2 – Basic Gameplay

My Custom Layout in Unity Development Environment

In this mission I undertook the bold task to program a top-down game with the objective of throwing food to hungry animals. To make things even more outrageous, the wild hungry animals are stampeding toward you and you must feed them before they can run past you. While working on this I became much more familiar with some of the most important programming and Unity concepts, including if-then statements, random value generation, arrays, collision detection, prefabs, and instantiation. I programmed a “Spawn Manager” to handle the spawning of random animals at random intervals. By completing this project I have demonstrated the ability to program a basic game complete with launching projectiles and maneuvering the player to keep the game alive.

https://meta.dwdenney.com/unit2/

Continue reading Unity Junior Programmer Mission: Create With code Unit 2 – Basic Gameplay

Unity Rotate Object

A simple script to rotate object in Unity

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Rotate : MonoBehaviour
{
    Vector3 movement;
    public int xi, yi, zi;

   
    void Start()
    {
        movement = new Vector3(xi, yi, zi);
    }

    
    void Update()
    {
        transform.Rotate(movement * Time.deltaTime);
    }
}


Add values to the public variables xi, yi, zi depending on the speed and direction you would like the object to rotate.

Unity Junior Programmer Mission: Create With code Challenge 1 – Program an Airplane to fly

I was challenged to use the skills learned in the driving simulation to fly a plane around obstacles in the sky. I was required to get the user’s input from the up and down arrows in order to control the plane’s pitch up and down. I also needed to make the camera follow alongside the plane in order to keep it in view.

Continue reading Unity Junior Programmer Mission: Create With code Challenge 1 – Program an Airplane to fly

Unity Junior Programmer Mission: Create With code Unit 1 – Start your 3D Engines

In this Unit, I programmed a car moving side-to-side on a road, trying to avoid (or hit) obstacles in the way. In addition to becoming familiar with the Unity editor and workflow, I learned how to create new C# scripts and do some simple programming. By the end of the Unit, I was able to call basic functions, then declare and tweak new variables to modify the results of those functions.

Continue reading Unity Junior Programmer Mission: Create With code Unit 1 – Start your 3D Engines

Sound and FX in the Metaverse

While most people think about the Metaverse as being a media that  involves visual art, there is an often overlooked area that can greatly enhance a metaverse project. Currently most apps and games have a pumping soundtrack and sword slashing game play. The ability to use 3D spatial audio effects to provide an exciting user experience has just started to be implemented.  Current projects are just scraping the surface of what can be done to provide a fun and exciting audio experience for the user. 

This project will demonstrate that I can produce high quality sound effects to greatly enhance the user experience. I was provided the virtual “set” and instructed to add a static background music as well as a 3D spatial surround sound effect. I placed the effect on a pot boiling on the stove. As you move closer you can hear the bubbling. I also added an Easter egg… if  you put your ear by the door, you can hear ambient sounds in the next room. Check it out and let me know what you think.

https://meta.dwdenney.com/audiodemo1

Screenshot of development environment

A/R Virtual Button

Image Target with 3D objects hovering over

We’ve covered the basics of AR targeting in the first few lessons and now we move on to an exciting feature: a virtual button that can recognize when you are touching it. I used Photoshop and designed a custom image Target in the style of a game board. There are placeholders for 3D models of a cube and a sphere, and there is a “button” as well.

The completed scene when run on your Android device will recognize button press and switch from a sphere to a cube hovering over the game board display.

viewing the image Target game board through the camera of an Android device.

The possibilities for interactive displays and art exhibits are endless. I look forward to seeing how this technology will grow and develop to be used more in the future. Feel free to contact me if you need any projects completed using this amazing technology.

Download the APK here https://meta.dwdenney.com/ARVirtualButton.apk and try it with this image target:

A/R Enhanced Comic Books

With this fun project I set out to enhance comic books using augmented reality technology. I chose a few covers from some of my favorites and tried to follow the theme of the comic book cover while adding augmented reality enhancements. The 3D objects and animations that enhance the scene when viewed through a camera seem to be a perfect combination.

Building on what I learned in my first project, I made five different AR targets and programmed each one with a different augmented reality effect. Some of them are quite complex such as smoke coming out of the chimney of a house and even characters that attempt to attack an enemy.

The first one is the cover of one of my beloved childhood comic book characters: Garfield. What could be better than looking at the cover through a camera and seeing Garfield trying to devour a steaming cheeseburger.

Continue reading A/R Enhanced Comic Books

Augmented Reality Application with Clothing Image Target

In this exciting project I created an augmented reality (A/R) application with a clothing based Image Target using the Unity 3D engine and A/R camera recognition.

DeeDub’s workspace in the Unity 3D engine

This application will let you view through your camera and see your surroundings enhanced with augmented reality. When the camera recognizes a certain image that has been programmed in, it’s able to place a 3D animated character on surface of the image.

Image Target with AR recognition

I programmed the camera to recognize a “Live Happy” logo that is on my wife’s apron. When the camera recognizes the logo it projects a 3D animated action figure walking around the logo. Once the image is tracked and the AR recognition has locked in place, you can move the device around and watch the AR camera match your movements.

Feel free to check out the APK (you’ll need to sideload it via developer mode on an Android device). One you load up the APK and install it on your device, open the app and point the camera at this logo:

A picture of a logo from an apron. It will be used as an image target in this application.

Full screen canvas overlay in Unity

There are many great uses for a full screen overlay. You can add splash screens, user interface elements and other features. Here is how to add a full screen overlay to your Unity Project.


To start with go ahead and create an Image GameObject.

In your hierarchy, right click and choose ui->Image.

This will add the Image Game Object as well as the Canvas as its parent. An EventSystem is also added.

To get a good view of the new Canvas Image element, make sure to enter 2D mode. Then you should select the Canvas GameObject in the Hierarchy, then place your cursor over the Scene and press F. Use zoom and scrolling to get your comfortable workspace settings.

Depending on your project you may want to take a look at the EventSystem GameObject. There are components attached to it which enable user interaction with any UI elements you might add to the project. If this does not apply to your project, you are free to delete the object from the hierarchy.

Looking at the inspector on the Canvas GameObject, the Canvas component has a RenderMode that should be set to the default of ScreenSpace – Overlay. This will stretch the image across the screen and ensure it is on top of any other content.

Screen Space - Overlay, where the Canvas fills the screen and all the UI elements of the canvas are rendered on top of everything else

There are two other components on the Canvas object: the Canvas Scaler and the Graphic Raycaster. The Canvas Scaler is a way of controlling the relative sizes of the UI elements when they are displayed on various screen sizes. The Graphic Raycaster is used to detect UI events. For example, when it detects a click, not only will it determine which UI element was clicked on, it will send the event to that element to be handled by the appropriate component.

We don’t need those two components for this project, so feel free to remove them from the Canvas GameObject.

Now we need to configure the Rect Transform component:

1. Make sure that the Image GameObject is selected in the Hierarchy window.

2. Find the Rect Transform component in the Inspector, then expand the Anchors setting.

3. Set the minimum values for x and y to 0. Set the maximum values for x and y to 1.

Now that the Anchor area of the Image is the whole screen, we no longer need an offset. Make sure to set the Left, Top, Right and Bottom properties to 0 on the Image’s Rect Transform

Your image now covers the entire screen and will stretch and move as needed depending on the screen size of the user’s device. I look forward to seeing what can be done with this, from start screens, end screens, custom user interfaces and more!