Hi guys, I have a cube controlled with this script:
var hit : RaycastHit;
var kocka : GameObject;
function Start () {
}
function Update () {
if (Input.GetMouseButton(0)) {
var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if (Physics.Raycast (ray, hit)) {
kocka.transform.position.y = hit.point.y;
}
}
if (Input.GetMouseButtonDown(0)) {
kocka.rigidbody.useGravity = true;
}
}
Cube I’m controlling is passing through other objects, but I don’t want it. I have added rigidbody to Cube and other object, and set Collision Detection to Contionuos.