I want to make a little Game in a adventure style. My wish is, that the player can click on an 3D Object, like an cube, and Drag it to any position in the Gameroom ( You must see the position). My second wish is, that an specific object transform itself when it touchs an other (specific) object.
I began scripting in unity script a month ago, and i think, it’s one of the easyiest scripting languages. But with my two problems above, I don’t find a solution.
I began with:
function OnMouseDrag ()
{
rigidbody.position = Input.mousePosition;
}
but the problem is, that " Input.mousePostion " give vectors for the mouseposition ON the screen and not in the game… At the left Bottom, it’s 0;0 and at the right top the screen width / high.
My second code second code starts with
function OnCollisionEnter(collision : Collision) {
}
But then, the function is played every time my objects hits another, like the ground… but it have to play this function only when it hits a specific object. I thought about OnCollisionEnter(collision : GameObject) but it ends in an error.
I will be very happy, when anyone can help me…
PS: Sorry for my bad English (if it is bad…) I’m german… You can correct me, if you want…