hi folks!
just playing around with nice unity to get in touch and better knowing each other...
i want to create a dounble sides textured card and want to rotate it by click and tried the following - please tell me from which point on it could be done better - still here to learn from you!
I took one Empty and two Planes as Children of the Empty. Then I added texture and turned one of the planes to face down.
I added a script with a OnMouseDown-Function in it to at least print me into the debug log.
problem: nothing happens, when i click onto the card.
is this because its an empty?how could I do better?
thanx!
edit: here is the code. just starting to play around...
var rotateSpeed = 250.0;
var rotating = false;
function Start(){}
function Update ()
{
if(rotating){
rotateCard();
}
}
function OnMouseEnter()
{
Debug.Log(gameObject.name + " OnMouseOver");
renderer.material.color = Color.red;
}
function OnMouseUp ()
{
rotating = true;
}
function rotateCard()
{
var theRotation = rotateSpeed * Time.deltaTime;
//if(theRotation <= 0.5){
print(theRotation);
transform.Rotate(0.0, 0.0, theRotation);
//}
}