Results 1 to 20 of 3564

Thread: (SSGX Origins) Let's make a Wipeout game! This time for real!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Apr 2010
    Posts
    1,529

    Default

    Quote Originally Posted by Amaroq Dricaldari View Post
    Why don't you just use an animated texture?
    I'm using a normal texture sheet and scrolling it down so it has a 3, 2, 1, GO! animation. Unity Free doesn't support animated gifs, png, flv, flash animation, etc.

    Quote Originally Posted by zero3growlithe View Post
    First of all: FixedUpdate () is ONLY for physics related functions because it runs between normal frame rate (faster than 30 times a sec, you can set how fast it executes in Time options of project)
    Secondly: Don't use 'for' loop for this, it is for another purposes, use something like this instead:
    var Timer : float = 0;
    var time : float = 0;
    function Update (){
    Timer += Time.deltaTime;
    if(Timer >= time){
    // place something here
    Timer = 0;
    }
    }
    You can check RaceStartCounter's script as reference
    The problem is that I want an integer variable to be multiplied by the distance between two slides, like: Between countdown start (texture offset 0) to "3" is "y" (y=0.1650390625 in this case) pixels, 2*y is the distance between the 0 and "2", 3*y is the distance between 0 and "1", and so on until GO!. Each of those cycles are paused by one second. I didn't want to use continuous offset, rather a "jump to" action, that's why I didn't use the default Time systems and used the "for" loop... My teachers always suggested me to use for loops whenever I want to link the loop code with variating values that affect it. I use it all the time in MATLAB, but I guess it's not as stable in Unity...

    I guess I found what's causing the problem: It's the yield WaitForSeconds(); pause function. But I don't know of any replacement for that. I wanted the script to pause 1 second after each loop...

    No matter! I turned Time.time into an integer and it worked, sort of. I just have to sync it with the ship release.
    Last edited by Xpand; 4th August 2012 at 07:31 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •