4/09/2010

3D Masters

Jin and Kevin have been making some pretty wild models!

Some ran into so-called facing problems (some surfaces appear invisible from one side) today.
This is created by so-called 'face normals' facing the wrong way.

The renderer sees every 3D face with a front and a back and will not render the back.

If you need a technical fix for this, like how to 'flip' the face normals, perhaps ask Kevin or Jin.

The walls in Jin's room have two sides: a side facing out and a side facing in.
This way, the walls always appear solid whichever angle you see them from.

Teleport 1.1 (putting the script on)

The Unity Scripting Reference is a good primer.

Some of us were stuck at the point where we 'put the script on the object'.
Hopefully this will help:

To create your script:

Assets > Create > Javascript

In the (script) editing window, paste in the script (see Ole's post), then save.

The script will appear as an item in the 'Project' folder (should be visible in the GUI; you may have to scroll).

Once you find it, drag the script onto the game object in the 'Assets' folder.

My bad script for triggering sound!

function OnTriggerStay() {

audio.Play();

}



I hope somebody can make a better one. I would love to have one that only trigger sound once and stuff. Just drag and drop this script to your object. Remember to also drag and drop a sound to the same object. Tip: Do not use scripts on the objects themselves, but rather on invisible (turn of mesh render) boxes surrounding them. Remember to check them off as IsTrigger.


Source:
Reading the Unity instructions

Teleport

var destination : Transform;

function OnTriggerEnter (other : Collider) {


if (other.CompareTag ("Player")) {
other.transform.position=destination.transform.position;


}


}


put that on the object that you want to cause the teleport and check trigger on its collider in the inspector panel, make sure there player is tagged player, and that you drag an object onto the destination var


when the player touches the teleport object it will be moved to the object you put in the destination var


source:
http://forum.unity3d.com/viewtopic.php?t=8425