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.

Search the Community

Showing results for tags 'time'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 9 results

  1. public void makeProduct(string message) { makeButton.gameObject.SetActive (true); makePanel.SetActive (true); make2button.gameObject.SetActive(true); totalDev.gameObject.SetActive(true); totalDev.GetComponent<Text>().text = "Total Development Cost: $" + totalMake.ToString(); GetComponent<timeScript>().StopTimer(); } public void stopProduct() { print (gameName); if (pickedsystem == "Develop for:") { } else { makeButton.gameObject.SetActive(false); makePanel.SetActive(false); } GetComponent<timeScript>().StartTimer(); } I tried to make it in my gameDictionaries script that time would freeze, then having it resume when stopProduct is started. Then I had the following in my timeScript script(note, a lot of info here is useless as it is used for other parts): void Start() { InvokeRepeating("Timer", 0, 1); } public void Timer() { timeText.GetComponent<Text>().text = "W" + week.ToString() + "" + year.ToString() + " Day " + day.ToString(); playerCash.GetComponent<Text>().text = "$" + myCash.ToString(); #region YEAR //Check if month equals 13 (allows for 12th month to be counted) if (month == 13) { year++; month = 0; } #endregion #region MONTH //Check if week equals 5 (allows for 5th week to be counted) if (month == 5) { month++; week = 0; } #endregion #region WEEK //Check if day equals 8 (allows for 7th day to be counted) if (day == 8) { week++; day = 0; } #endregion #region DAY //Check if Time equals 5 (allows for 4 seconds) if (time == 1) { day++; time = 0; } else { time++; } #endregion if (week == 2 && month == 0 && year == 1980) { alert.PopUp("Welcome to iDeveloper! This is a pre-playable build that is not intended for consumer use"); } else if (week == 4 && month == 0 && year == 1980) { alert.PopUp("To create a game, go to Make Game"); } else if (week == 1 && month == 1 && year == 1981) { alert.PopUp("Create a game so you can earn money and grow your company!"); print("FES Coming in 4 years"); } print(week); print(month); print(year); } public void StartTimer() { InvokeRepeating("TimerFunction", 0, 1); Time.timeScale = 1f; } public void StopTimer() { CancelInvoke("Timer"); Time.timeScale = 0; } } The issue is, time isn't resuming when StartTimer is called. What could I do to get time to resume?
  2. Hey, I've been doing this code for my game that lets you dynamically travel in time so you can control what year you're currently in. It works fine, and certain objects will appear and disappear depending on if they exist in the time you're in. However, what I'm trying to do is make it so that if you move a rigidbody in say the year 1000 and then travel to the year 1100 and move the rigidbody, and then travel back to 1000, the rigidbody would return to the position it was in back in the year 1000 because that was where it was in the past and return to the position it was in in the future (1100). The script for the objects affected by time is below. I appreciate any help I can get. I've tried to word this as well as I can but I'm still not too sure if this makes sense. Thanks for any help. This is the script for the objects affected by time travel. var timeHandler : TimeManager; var existantAt = 100; var nonExistantAt = 300; private var startX : float; private var startY : float; private var timeOfChange : int; function Start(){ startX = transform.localScale.x; startY = transform.localScale.y; //Do After transform.localScale.x = 0; transform.localScale.y = 0; canSetCurPos = true; if(rigidbody){ rigidbody.isKinematic = true; } } function Update(){ timeHandler = GameObject.FindObjectOfType(TimeManager) as TimeManager; if(transform.localScale.x == startX && transform.localScale.y == startY){ if(rigidbody){ rigidbody.isKinematic = false; } } //Check if the object exists in the year you're in if(timeHandler.time > existantAt && timeHandler.time < nonExistantAt){ Exist(); } if(timeHandler.time < existantAt || timeHandler.time > nonExistantAt){ Nonexist(); } } function Exist(){ collider.enabled = true; transform.localScale.x = startX; transform.localScale.y = startY; } function Nonexist(){ if(rigidbody){ rigidbody.isKinematic = true; } collider.enabled = false; transform.localScale.x = 0; transform.localScale.y = 0; }
  3. so , i made this AI script for my game that makes the transform simply wander... but i want it to stay idle for 5 seconds after every 10 seconds he walks. i have no idea what i should use.. var moveSpeed : float = 2; var rotSpeed : float = 10; var moveDir : int = 1; internal var animator : Animator; enum status { walking, idle } var state : status; function Start () { animator = GetComponent(Animator); } function Update(){ if(state == state.walking){ moveSpeed = 2; rotSpeed=10; if(!Physics.Raycast(transform.position, transform.forward, 5)) { transform.Translate(Vector3.forward * moveSpeed * Time.smoothDeltaTime); } else{ if(Physics.Raycast(transform.position, - transform.right, 1)) { moveDir = 1;} else if(Physics.Raycast(transform.position, transform.right, 1)) { moveDir = -1;} transform.Rotate(Vector3.up, 90 * rotSpeed * Time.smoothDeltaTime * moveDir); } } if(state == state.idle){ animator.SetBool("idle",true); animator.SetBool("walking",false); } }
  4. Hello im looking for tester for my game. These tester will b able to be called on any time i need them to test. *Note* They don't have to always be on/test. By agreeing to test you are basically saying that you wouldn't mind joining in a test with me. So far: - jolo309 - UltimateKettle11
  5. This is the "Systems" Time, "Hour, Minute, Second." Comes with a example GUI. I made this in like 2 minutes while i was thinking of a design for my HUD, So if its useful for someone, Why not post it on the best Unity3D Forums. #pragma strict var mySkin : GUISkin; var hour : float; var minute : float; var second : float; var amPm : float; function Start () { } function Update () { hour = System.DateTime.Now.Hour -12; second = System.DateTime.Now.Second; if(minute < 10){ minute = 0 + System.DateTime.Now.Minute; } else { minute = System.DateTime.Now.Minute; } } function OnGUI(){ GUI.skin = mySkin; GUI.Box(Rect(Screen.width/2 + -75, Screen.height/2 + -25, 150, 50), "Time"); GUI.Label(Rect(Screen.width/2 + -30, Screen.height/2 + -3, 100, 50), hour + " : " + minute + " : " + second); } Hope this helps. Good luck!
  6. Here is a simple Count Up Or CountDown Timer, I made this to see if i could, Guess i could, Here is the code. Javascript C# To use this place the script on a GameObject, Create a GUIText & Assign the GUIText into the script, Select the count Up if u want it to count up, Or it will count down, S - Start - Stop. R - Restarts. "Resets it to the DefaultTimer Variable" Hope this is helpful for someone, Have Fun!
  7. I have to sign in to armed unity nearly 20 times a day just because it only takes about two minutes to automatically log me out of my account. I'm sure other members notice this. Could someone please change this? It gets pretty annoying. It actually signed me out while I was writing this!
  8. Hi All... A while back aldonetto from answers.unity3d helped me get a teleport script working. I have modified to have Audio - Particle FX (Though particle FX Wont Disable) Here is the script, Below it i will post info on the actual issue So.. When the raycast hits and teleports me there... I don't want it to be instant.. I want it to take a little time.. like.. 1.5 So my particle FX can have enough time to play and still look - function beautifully. I'm not sure how to use timers or pretty much anything to do with vectors - transform.. So this has been pretty much impossible for me to do myself. So I'm here "Best Unity Community" Asking For Your Help! Information is greatly appreciated, Thank you for the time you took to read this post .
  9. Who else is surfing around here everyday? I even has the website as my homepage
×
×
  • Create New...