using UnityEngine; using System.Collections; public class porkamine : MonoBehaviour { public string kirjeldus; public GameObject alumine; // Use this for initialization void Start () { Debug.Log ("algus2 "+kirjeldus); //Rigidbody rb = GetComponent (); //rb.mass = 0.1f; //rb.AddForce (Vector3.left * 30); //transform.position = new Vector3 (2, 2, 1); //alumine.transform.position = new Vector3 (1, -2, 1); GameObject uus = (GameObject)Instantiate (alumine); uus.transform.position = Vector3.right * 2; } // Update is called once per frame void Update () { // Debug.Log ("edasi"); } void OnCollisionEnter(Collision teine) { Debug.Log("porge "+teine.collider.name); if (teine.collider.name=="alumine") { transform.position+=Vector3.up*0.5f; // transform.rotation=Quaternion.Angle. } } }