Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

mgudoy

Member
  • Content Count

    61
  • Joined

  • Last visited

Community Reputation

1 Neutral

About mgudoy

  • Rank
    Member

Profile Information

  • Gender
    Male
  • Location:
    Manila
  • Interests
    I like Coding but I love Downloading
  1. I want a script where the detector prioritize first the first detector and continued up to the sixth detector I want it to be in a tag mode but I don't know where to start
  2. using UnityEngine; using System.Collections; public class Tilt : MonoBehaviour { void Update () { transform.Translate(Input.acceleration.x, 0, -Input.acceleration.z); } } How to calibrate my tilt function ? That when I am sleep position my tilt will not affected .
  3. I want to make a tilt effect on my object
  4. mgudoy

    Countdown Timer

    #pragma strict private var startTime : float; var textTime : String; //First define two variables. One private and one public variable. Set the first variable to be a float. //Use for textTime a string. function Start() { startTime = Time.time; } function OnGUI () { var guiTime = Time.time - startTime; //The gui-Time is the difference between the actual time and the start time. var minutes : int = guiTime / 60; //Divide the guiTime by sixty to get the minutes. var seconds : int = guiTime % 60;//Use the euclidean division for the seconds. var fraction : int = (guiTime * 100) % 100; textTime = String.Format ("{0:00}:{1:00}:{2:00}", minutes, seconds, fraction); //text.Time is the time that will be displayed. GetComponent(GUIText).text = textTime; } I'm confused how can I use this timer to count backwards? :/ Help!!
  5. How can I make a collider of tags which will count only once !
  6. The GetComponent is not working for me because my variable has an integer. (var Lives = 3;) So what I did is... SpawnPoint.js I made my variable public static variable (public static var Lives = 3;) - This means that the variable is connected to any script when called then Hole.js I made also the same method and call the SpawnPoint script and use in the function of Lives SpawnPoint.Lives -= 1; objectInArea = false; savedWaitTime = waitTime; if(SpawnPoint.Lives == 2){ Life3.enabled = false; Life2.enabled = true; Life1.enabled = true; } if(SpawnPoint.Lives == 1){ Life3.enabled = false; Life2.enabled = false; Life1.enabled = true; } if(SpawnPoint. == 0){ Life3.enabled = false; Life2.enabled = false; Life1.enabled = false; GameOverRetry(); and it went well Sorry for annoying you all! but thanks in helping guys!
  7. It said the GetComponent is not a member of int?
  8. I tried it earlier but the lives is malfunctioning I'm working for this in 2days and im stuck
  9. I want the Hole.js count the lives of SpawnPoint.js
  10. This Hole.js var SpawnPoint : Transform; public var PowerMeter; var Pamato : GameObject; var Lives = 3; var objectInArea : boolean = false; var waitTime : float = 5.0; private var savedWaitTime : float; var GUIScore : GUIText; var GameOver : String; var Life3 : GUITexture; var Life2 : GUITexture; var Life1 : GUITexture; function Start(){ Life3.enabled = true; Life2.enabled = true; Life1.enabled = true; savedWaitTime = waitTime; } function OnTriggerEnter(col : Collider){ if(col.tag == "GameController"){ objectInArea = true; } } function OnTriggerExit(col : Collider){ if(col.tag == "GameController"){ objectInArea = false; savedWaitTime = waitTime; } } function Update(){ if(objectInArea){ if(savedWaitTime > 0.0){ savedWaitTime -= Time.deltaTime; if(savedWaitTime <= 0.0){ Pamato.transform.position = SpawnPoint.position; Lives -= 1; objectInArea = false; savedWaitTime = waitTime; if(Lives == 2){ Life3.enabled = false; Life2.enabled = true; Life1.enabled = true; } if(Lives == 1){ Life3.enabled = false; Life2.enabled = false; Life1.enabled = true; } if(Lives == 0){ Life3.enabled = false; Life2.enabled = false; Life1.enabled = false; GameOverRetry(); } } } } } function GameOverRetry(){ yield WaitForSeconds(2); Application.LoadLevel(GameOver); } This is my SpawnPoint.js var SpawnPoint : Transform; public var PowerMeter; var Pamato : GameObject; var Lives = 3; var objectInArea : boolean = false; var waitTime : float = 5.0; private var savedWaitTime : float; var GUIScore : GUIText; var GameOver : String; var Life3 : GUITexture; var Life2 : GUITexture; var Life1 : GUITexture; function Start(){ Life3.enabled = true; Life2.enabled = true; Life1.enabled = true; savedWaitTime = waitTime; } function OnTriggerEnter(col : Collider){ if(col.tag == "GameController"){ objectInArea = true; } } function OnTriggerExit(col : Collider){ if(col.tag == "GameController"){ objectInArea = true; savedWaitTime = waitTime; } } function Update(){ if(objectInArea){ if(savedWaitTime > 0.0){ savedWaitTime -= Time.deltaTime; if(savedWaitTime <= 0.0){ Pamato.transform.position = SpawnPoint.position; Lives -= 1; objectInArea = false; savedWaitTime = waitTime; if(Lives == 2){ Life3.enabled = false; Life2.enabled = true; Life1.enabled = true; } if(Lives == 1){ Life3.enabled = false; Life2.enabled = false; Life1.enabled = true; } if(Lives == 0){ Life3.enabled = false; Life2.enabled = false; Life1.enabled = false; GameOverRetry(); } } } } } function GameOverRetry(){ yield WaitForSeconds(2); Application.LoadLevel(GameOver); } I want that my lives to will change to the same script when the object hitted the collider it will minus the lives of both scripts
  11. This is my script function Shoot(power : float){ shooting = true; var fwd : Vector3 = spawnPos.forward; Pamato.AddForce(fwd * power * shotForce); guiTexture.transform.localPosition.x = 0.125; thePower = 0; shooting = false; Pamato is the gameobject hmm is there a possible way that the object will change direction?
  12. mgudoy

    Meter Bar Problem

    Where will I apply the MinValue and MaxValue
×
×
  • Create New...