- Home /
Stage selection problem
Hi everyone! Here's my problem now. I am writing a script for a game. Now I'm at doing the part where there'a stage selection on choosing which part of the game you would like to go. The stage selection consists of 4 parts(90 degrees each) which will rotate to the front on a click of the mouse. Now here's the problem :
The 90 degrees rotation is not performed fully on a mouse click as it stops at around 10 degrees or so.
When it reaches the 1st 90 degrees it wont move anymore.
This is my script :
function Update () {
if (Input.GetButton("Fire1"))
var toRot : Quaternion = Quaternion.Euler(0, 90, 0);
transform.rotation = Quaternion.Slerp (transform.rotation, toRot, Time.deltaTime * 0.5);
}
Any help will be greatly appreciated!
Answer by Waz · Aug 07, 2011 at 03:19 PM
You only rotate while button is down.
Nothing says which of the 4 stages - you just rotate 90 about Y.
Try coding a bit more to do that otherwise an answer would be just writing it all for you.
$$anonymous$$y bad. $$anonymous$$y idea is that I'll place the stages with 90 degrees distance from one another. I didn't know that I'm just rotating while button is just down. I'm new in scripting sorry =( I'll check further on my script.