How to get an object to point in a certain direction?

Fairly simple I would assume. What I need is a way to keep an object up-right.

I want the top of the object to be pointing up, but not locked there. I would like to have the object simply TRY to stay upright. So that the player can knock the object around, but the object always returns to facing upright.

Any help is greatly appreciated!

Here is a simple script that may solve your problem.

#pragma strict

var qTo : Quaternion;
var speed = 10.0;

    function Start() {
    	qTo = Quaternion.Euler(Vector3.up);
    }
    
    function Update() {
       transform.rotation = Quaternion.Slerp(transform.rotation, qTo, Time.deltaTime * speed); 
    }