Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
Procedural Death Jam

Work Begins on a DeathJam Project

Nighzmarquls
Saturday, March 8, 2014 - 11:51

Some Design Hashing happened a little bit after the official start date, and then today I started digging into unity and wrangled up a decent solution for doing billboard style sprites:

This took me a bit to find the best solution on short notice, but I figure it would be helpfull for anyone who wanted to use unity for a more 3D feel without getting into the complications of model assets:

 

This is a C# script that I mostly lifted off the unity wiki, but was slightly modified for better performance, (calls to transform on an object are slightly slower then caching the transform reference before hand and calling from that).

Just drop it onto a sprite and you should be golden for making it always face the camera in a sensible way.

public class billboard : MonoBehaviour {

public Transform m_CameraTransform;

private Transform m_Transform;

// Use this for initialization

void Start () {

if(m_CameraTransform == null)

{

m_CameraTransform = Camera.main.transform;

}

 

m_Transform = transform;

}

 

// Update is called once per frame

void Update () {

m_Transform.LookAt(m_Transform.position + m_CameraTransform.rotation * Vector3.back,

                  m_CameraTransform.rotation * Vector3.up);

}

} 

  • Log in or register to post comments
Danimal
joined 14 years 11 months ago
Saturday, March 8, 2014 - 12:04

I like your project concept and wish i can play it soon, also, i think you can benefit a lot from the assest of "Ufo: alien invasion" which is open source and ready to use (just calling your attention on that).

  • Log in or register to post comments