- Home /
rallenty scroll main texture
Stupid question that I can not get out. I have a hanging object to 3 balloons and the background behind with a script mainTextureScroll to give the sense of upward movement. When a balloon is hit to slow the "ascent" of the object. how can I slow it down? I tried to decrease the variable scroll to slow down but there is the shot of the background to start from the starting point.
Code:
var balloonGreen : GameObject;
var balloonRed : GameObject;
var balloonYellow : GameObject;
function Start(){
balloonGreen = GameObject.FindGameObjectWithTag("Verde");
balloonRed = GameObject.FindGameObjectWithTag("Rosso");
balloonYellow = GameObject.FindGameObjectWithTag("Giallo");
}
function Update(){
var test = Time.time * scroll;
var testuno = Time.time * 0.10;
renderer.material.mainTextureOffset = Vector3(0,test,0);
if(balloonGreen.gameObject.renderer.enabled == false){
}
}
Comment
That code is unreadable - please reformat it. Watch the video if you don't know how.