Honkbark studios menu logo

C#

TapController Unity3d tutorial
  • June 7, 2016

TapController Unity3d tutorial

In this TapController Unity3d tutorial we’ll create a script that will work so that when the player taps the screen, a force is added to a GameObject. This technique is used in Friendsheep. This code is open sourced, and you can download it from the unity examples repository. This is the finished TapController.cs. As an example have a […]

DontDestroyOnLoad tutorial
  • April 19, 2016

DontDestroyOnLoad tutorial

This is a simple DontDestroyOnLoad tutorial for unity3D. It is used to keep game objects alive during for example scene reloads. In this tutorial we will look at how to keep game music playing while reloading a scene. This technique is used in Friendsheep. You can download or clone this tutorial from this repository on Github. This tutorial […]

Unity3d game volume
  • August 11, 2015

unity3d game volume

There is a global volume setting for unity games that is simple to use. It’s called AudioListener.volume. In this example we will toggle the volume on and off in a game by the click of a button. The code in this example is published on Github and after each step you can have a look at how […]

Saving data in unity
  • July 8, 2015

Saving data in unity

This tutorial will cover how to save data to disk or device that can be loaded again after the game has been shutdown and restarted again.  You can download or clone this tutorial from this repository on Github. This technique is used in Friendsheep. 1. Let’s begin with setting up the scene. Start by adding […]

How to check if an object has stopped moving in unity
  • June 6, 2015

How to check if an object has stopped moving in unity

There were a few suggestions on how to check if a gameobject has stopped moving in unity. Some of them were scripts that did the trick. However the solutions that worked best was to check if the objects rigidbody2d isSleeping(); This Technique is used in Friendsheep. using UnityEngine; using System.Collections; public class StuckSheepCheck : MonoBehaviour […]

Stopcoroutine not working
  • March 20, 2015

StopCoroutine not working

After playing around with StartCoroutine  to spawn different kind of game objects i had some trouble using StopCoroutine to halt the spawning. My first try was to use StopCoroutine right away, the same way that StartCoroutine is used: using UnityEngine; using System.Collections; public class EnvironmentSpawner : MonoBehaviour { public GameObject LargeCloud; void Start() { StartCoroutine(SpawnLargeClouds()); } […]