he guys,
im having trouble limiting my zoom. i have this code so far
the code for scaling
if (GUI.RepeatButton(pos5, "zoom in"))
{
transform.localScale.x += 0.0007; // maak het object bigger
transform.localScale.y += 0.0007;
transform.localScale.z += 0.0007;
}
if (GUI.RepeatButton(pos6, "zoom out")) // maak het object smaller
{
transform.localScale.x -= 0.0007;
transform.localScale.y -= 0.0007;
transform.localScale.z -= 0.0007;
code for limiting
function Update (){
transform.localScale.x = Mathf.Clamp(Time.time, 0, 0.5);
transform.localScale.y = Mathf.Clamp(Time.time, 0, 0.5);
transform.localScale.z = Mathf.Clamp(Time.time, 0, 0.5);
}
i think im missing a float variable or something. cuz now the object gets scaled to the 0.5 and its not a limit somehow.
im still scratching ,my head with this :(
could someone help me?