Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[70% OFF!] UniStorm 5.2 - AAA Volumetric Clouds, URP Support, Weather, Sky, Atmospheric Fog, & More!

Discussion in 'Assets and Asset Store' started by BHS, Jan 27, 2012.

  1. Joeronimoe

    Joeronimoe

    Joined:
    Dec 15, 2015
    Posts:
    12
    I would be much appreciative if anyone could guide me on how I might get UniStorm working with Photon Bolt. I saw the PUN sample in the UniStorm wiki, but unfortunately I have never worked with PUN and RPC's, so trying to figure out has me a bit lost. I know I will need a weather state, and pass the variables through it. I think I am close, but yet so far away.. lol.. Any help will be greatly appreciated.
     
  2. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    Make the Unistorm a scene entity using a state with properties for each of the variables you want to sync, on the host make it apply the variable to the state, on the clients apply the state properties to the Unistorm controller
     
    Joeronimoe likes this.
  3. RoyS

    RoyS

    Joined:
    Jan 12, 2009
    Posts:
    664
    Is there a way to add a second alien moon (with another texture)?

    My game takes place in space, but the player can return to earth and go to another planet. Can I have the earth moon for one planet and two alien moons for the alien planet or is this not possible?

    If we can't do two moons, can I have the earth moon and on the other planet have an alien texture for the other moon? If this is not possible, no problem.
     
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    It's certainly possible. See the post here on how to do so: https://forum.unity3d.com/threads/r...storm-mobile-free.121021/page-87#post-2942219
     
    arnesso likes this.
  5. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    hi,

    some questions and may be bugs i found

    - is possible to increase the heavy snow intensity (more than 5000 actually) and heavy snow dust intensity(50 actually)? the same for rain?

    - i notice that in summer time if you choose the light rain it snows and rains at the same time
    - the wind storm is activated in light rain too and it must not in my opinion

    thanks
     
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    Yes, it is possible, but it requires adjusting UniStorm's Editor script.

    1) Open up the UniStormEditor_C Script.
    2) Press Ctrl+F to bring up the search tool and search for the following line:
    Code (CSharp):
    1. self.maxStormRainIntensity = EditorGUILayout.IntSlider ("Heavy Rain Intensity", (int)self.maxStormRainIntensity, 1, 5000);
    3) Change the 5000 portion of the above code to the max value you desire. This will be the new cap for the UniStorm Editor.

    I tested the Light Rain weather type during Summer and there is no snow or stormy wind. Everything is working exactly as it should. This is using the newest version from the Asset Store. I'm not sure why you are seeing this. It could be because your temperature is right around freezing, but the default has summer as warm. You can see by looking at the Temperature Graph in the UniStorm Editor under Temperature Options.

    Can you please answer a few questions for me:
    Can you give me the steps to recreate your setup?
    What's your version of UniStorm?
    What's your version of Unity?
     
  7. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    thanks!! Snap 2017-02-09 at 09.21.35.png Snap 2017-02-09 at 09.22.32.png

    My setup in the screenshots.I am using mountainous climate,celsius(may be is here the problem with celsius degrees,change from farenheit may be gets all messed) and simple temperature.Last versions of unity and unistorm.
    In the screenshots you can see the light rain with 29 º in august, and is raining and snowing and the windzonestormy is enabled too.
     
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Thanks for the info!

    It looks like UniStorm isn't calculating the temperature based on Celsius, when it should be.

    Is this happening with Instant Weather (right when you start the scene the weather is updated) or when you change the weather and it slowly transitions during runtime? It looks like Instant Weather isn't calculating Celsius, which will be an easy fix. It's supposed to snow at 32° Fahrenheit or 0° Celsius.

    If there's an issue, we will fix it with a quick update.
     
  9. txarly

    txarly

    Joined:
    Apr 27, 2016
    Posts:
    197
    you are welcome!!

    the instant weather has more issues as i have checked, but without instant weather checked a have noticed that snow storm winter only in december(winter) does not activate the windzonestormy component.I suggest to check the different weathers in celsius with fog,rain/snow and wind even in instant and transitions.

    It would be nice, in my particular opinion as an update to be able to create by the user different weathers.I mean, may be possible to create a weather with different grades of light snow/fog/wind/temperature so the user can create a light snow with slow wind and strong fog and low temp , or the same with light fog , or heavy rain with no fog and high temp or heavy rain with a lot of fog and low temp.Basically if you create a weather zone or a general weather class, let´s say foggy, the chance to create different types of foggy(light,medium and hard)

    hope to help you to improve this amazing asset!!
     
  10. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Hey there,

    I have a problem with the sky and sun only updating every second or so. There is a noticeable jump, while the rest of the game runs fluent. Do you have any idea what could cause this and how I can solve this?

    Thanks a lot,
    Best regards,
    Patrick
     
  11. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    @BHS Is it possible, as you have added the HDR sun in the skybox shader (which you forgot to add in the update notes) to control this intensity through UniStorm? I.E. having a curve that we can modify depending on the time of day?
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Thanks for bringing this to our attention. We'll fix it with a quick update that should be submitted sometime this week.

    Great suggestion. We do plan on updating the way weather types are generated. Customized weather types sounds like a good idea.


    Strange, it should be consistently updating. It is in FixedUpdate so if your Fixed Timestep is set to 1, it would be updating every second. Other than that, the default setting is 0.0.1 so I'm not sure why it wouldn't be updating every 0.01 seconds. Fixed Update was used because it showed slightly better performance compared to having the sun update in the Update function, according to the Profiler. What are your settings so I can see if I can recreate your issue? Everything is working fine on my end using the newest version of UniStorm.


    Thanks for the suggestion. It should be possible to have HDR control based on the time of day. We can add it with the next version or two.
     
    Lohrion and Stormy102 like this.
  13. GOLDY00

    GOLDY00

    Joined:
    Mar 16, 2013
    Posts:
    139
    Just wondering cause there is no sun_moon how do you do he sun and moon to be visible properly now
     
  14. Lohrion

    Lohrion

    Joined:
    Aug 16, 2013
    Posts:
    107
    Sorry for the confusion. I actually set the fixed timestep to 1, but failed to see a connection to my issue. Thanks alot!
     
  15. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    347
    Hello everyone,

    I m trying to integrate my Time/Day system of my game with UniStorm, Could you tell me the basic stuff i need to have in mind before starting to integrate them? Like which component handles the time/day and how to call it etc.

    thank you
     
  16. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    You just add the Sun Light object instead of the sun_moon object.


    No worries, great to hear everything is working right.


    Hey there!

    If you look for the line:
    Code (CSharp):
    1. if (timeStopped)
    You will see UniStorm's time control. This if statement is what makes UniStorm's time tick. If you comment out this if statement, UniStorm's time will no longer tick. You could also add your own referenced variables in this if statement to control UniStorm's startTime variable. This should allow your time to control UniStorm's. However, startTime has a max value of 1.0 so you will need to use the following equation for converting your time to UniStorm's time.
    ConvertedTime = YourHour / 24 + YourMinute / 1440

    If you do this, your system should work with UniStorm. With the script open, Press Ctrl+F to search for startTime. You may need to edit 1 or 2 other parts in the InitializeUniStorm function.
     
  17. bpears

    bpears

    Joined:
    Aug 23, 2012
    Posts:
    249
    Hi, the procedural skybox does not change over time for me, it's always mid-day blue, whats up with that?
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
  19. tylerw-savatronix

    tylerw-savatronix

    Joined:
    Nov 10, 2013
    Posts:
    90
    Hi there,

    My team and I are looking at using this asset for our upcoming game, Lost Haven (a 3D anime-style JRPG inspired by Harvest Moon/Rune Factory, and old school JRPGS) and had a few questions I wanted to ask to see if this asset will fill our needs.

    As a technical approach, we're instantiating most objects via code. This allows us to create JSON files so that people who want to mod most aspects of the game will have an easily approachable way to do so. The downside is this can make working with assets that are solely setup around prefabs and the editor a bit of a pain.

    1) How is UniStorm when it comes to building everything in code?
    2) Is there a god class for interaction with the system (seen this in a few assets and it's been a pain) or is it made up of compartmentalized classes?

    For our game, we're following a similar suit to games of the genre and condensing a year down into 4 Season-months of 31 days each. Weather patterns will be semi-randomly determined and will persist the whole day (though we are tinkering with the idea of allowing a weather change halfway through the day). For example, in Winter it may be clear/cloudy with previously accumulated snow, or lightly snowing, or a full out blizzard. Or in Summer it may be hot and dry, or a nice summer rain, or a typhoon/hurricane (though the more severe weather will be limited to only happening like once a week).

    3) Is it possible to achieve the more severe weather patterns (blizzard, typhoon/hurricane, severe thunderstorm)?
    4) Since our condensed months don't correspond 1:1 to real months (it'll be something like the first week or of, say, Spring will correspond to typical March weather, the middle of the month would correspond to April, and the end would correspond to May) is it possible to achieve that, but to also get a full lunar cycle each month?
    5) Does the moon position itself in the sky about where it would be for a given lunar cycle?

    We also have our own custom game time system that all of our systems make use of. It basically runs similar to how DateTime works (tracks ticks and converts to our custom calendar). It is 24h based. It shoots out an event every time there's a time tick, and the various systems are subscribed to that.

    6) Is it possible to essentially disable the UniStorm time tracking and instead write a class to feed it our game time and retain all or most of the things that rely on UniStorm's time tracking system? Basically I want to sync UniStorms time to our time.

    We'd also really love to get some Auroras into the game (cause they look damn awesome). I didn't see it in the feature list though.

    7) Are auroras a feature, or at least a planned feature?
    8) If not, how difficult do you think it would be for us to merge in an aurora system?

    Thanks much!
     
  20. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    1) It's great. We use our own custom saving system and it works beautifully. Networking is a breeze too.
    2) It's a single class that controls everything to do with weather and time
    3) Yes you can make custom particle systems to make the severe weather even worse
    4) You can create your own custom Calendar
    5) I don't believe so, but it has moon phases
    6) You can use your own custom tick rate for UniStorm by disabling progressing time and setting the tick
    7) Trust me, I've been begging for three things and auroras is one of 'em. (Others are real star positioning and rain on screen effect). They are definitely on the upcoming features list.
    8) Not really difficult, but I'm pretty sure that they are upcoming

    BHS is very busy but also very responsive. I wanted HDR for the skybox shader - Done. Controlling HDR intensity via the UniStorm is upcoming. Either way, I think this is a beautifully well made Day/Night cycle system and it is really promising.
     
    BHS likes this.
  21. tylerw-savatronix

    tylerw-savatronix

    Joined:
    Nov 10, 2013
    Posts:
    90
    It looks like #1 may be not as feasible as I thought as I've been looking over the docs. It looks like Unity has yet to expose the lighting API, and so assigning the sun to the sun field of the lighting window can't be done via script (requires a prefab in the scene at design time).

    Though this is going to be a problem with any system and is more a Unity limitation until they expose those properties for use at run time. There are some work arounds but they're not pretty (add the prefab to the scene in a disabled state, create a "helper" game object that holds a reference to the disabled prefab, grab the reference in code and selectively enable it after setting its properties up in code).

    #2 is also kind of a huge turn off, and I'm not sure why Unity asset makers specifically seem to be using this anti-pattern very regularly. My best guess is it takes a bit less work when it comes to displaying the component's properties in the editor but using something akin to Composition Over Inheritance (where you would make the "main" class simply hold other classes that follow SRP more closely) is not all that difficult to get things to display correctly in the editor.

    God-classes make working with the system in code more difficult, and testing a nightmare (try mocking an object that has hundreds of properties and methods. It's brutal and generally not even feasible). It's one of the main reasons we were looking to move off the asset we're already using for weather and day/night.

    #6 Do you mean setting a custom tick rate, or specifically setting the time? The first isn't desirable, the second is (basically I need to tell the system what time it is instead of trying to rely on synchronizing rates of time, which can become desynced as they're more than likely determining time differently. We also have time jumps, such as when the player sleeps every night).
     
    Stormy102 likes this.
  22. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    I can tell you that #1 can be achieved as we use it ourselves (we load in a level with GI additively and set the sun and skybox) https://docs.unity3d.com/ScriptReference/RenderSettings-sun.html

    #2 Well, we like having manager classes for our stuff - works miracles with Steamworks but I can appreciate that this would be the biggest issue for you

    #6 You can disable time passing and then set the time based on your own tick rate. Like I said, we syncronise over the network and save/load the time and weather.
     
  23. tylerw-savatronix

    tylerw-savatronix

    Joined:
    Nov 10, 2013
    Posts:
    90

    #1, Ah so they did finally expose that setting. That's great news. The internet was kind of scarce there, and it's still up as a feature request on the site.

    #6 Thanks, I was getting some ambiguity in your original response. Thank you for clarifying.

    I'd still like to hear from the devs though and get their take on whether they think this would be a good fit. If there are plans for them to create interfaces to segregate some of it that would be a hhuge bonus (though not really something I'd expect since then they'd have to make all public variables into properties to get an interface abstraction to work).
     
    Stormy102 likes this.
  24. GOLDY00

    GOLDY00

    Joined:
    Mar 16, 2013
    Posts:
    139
    Hi everyone I'm just wondering how can I make the survival ui warmth act like a realistic scale so say normal temp 32 as it gets hotter in game it might go higher or colder then the warmth goes down how can you do this with unistorm and the survival ui
     
  25. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Happy to help. BHS often can take a few days to reply but I'm often around to help.

    You can get the current temperature by having a reference to UniStorm and using the temperature
    Code (CSharp):
    1. private UniStormWeatherSystem_C uniStorm;
    2.  
    3. void Start()
    4. {
    5.  
    6.     GameObject UniStormWeatherSystemObject = GameObject.Find("UniStormSystemEditor"); //Find the UniStorm GameObject
    7.  
    8.     //Assign the UniStorm script as a script object so you only call Get Component on start once
    9.     uniStorm = UniStormWeatherSystemObject.GetComponent<UniStormWeatherSystem_C>();
    10. }
    11.  
    12. void Update()
    13. {
    14.      if (UniStormWeatherSystemScript.temperature >= 33)
    15.     {
    16.          Debug.Log("It is above freezing");
    17.     }
    18.  
    19.     if (UniStormWeatherSystemScript.temperature <= 32)
    20.     {
    21.          Debug.Log("It is below freezing");
    22.     }
    23. }
    Ultimately design decisions are up to you. If you are referencing an asset called Survival UI I couldn't find it, so could you post a link. Also, your answer is a little unclear as to what you are asking for.
     
  26. Deleted User

    Deleted User

    Guest

    Hi, I've some problems with the upgrade to 2.31. When I upgrade from 2.24 to 2.31 into an existing Weather System all Rain and Snow (which works in 2.24 perfectly fine) does not work anymore - no particles (now snow flakes, no rain drops). Also the weather changes rapidly fast when the player enters a new weather zone ?? I checked all settings, but I have no clue what to do anymore. Currently I'm running Unity 5.4.2.
     
  27. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Try importing it into a fresh project and see if it happens in that. Also, you might need to copy across the settings - this will be made easier due to the settings exporter in 2.3
     
  28. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    1) If you can instantiate UniStorm as a whole, it's simple. You just need to apply the UniStorm components to the player. We have a script include that demonstrates instantiating a player and applying the player components to UniStorm.
    2) UniStorm uses a single class. However, this class gives you access to every relevant variable to customize UniStorm via code. You can change and read anything through code such as weather, time, date, season, temperature, current rain and snow intensity, light intensity, moon phase, and more.

    UniStorm generates a weather type every 24 hours depending on the weather odds set within the UniStorm Editor. UniStorm uses 2 odds, one controls the chance for clear weather types (Mostly Clear, Partly Cloud, Sunny, etc), the other for precipitation weather types (Light Rain, Heavy Rain, Thunderstorms, etc).The intensities of each storm varies with the help of the Randomize Precipitation feature. This feature will generate new precipitation amounts for each storm making each storm's intensity unique. If you want to customize and generate your own forecasts, you can do so by disabling UniStorm's weather generation and generating your own with a custom script.

    We have an example system included with UniStorm that allows you to generate weekly forecasts Monday-Sunday. Each day has its own weather type and is updated at the start of a new day. After an in-game week has been completed, UniStorm will generate a new weekly forecast. You could use this, or use it as a starting point, to get the weather generation you are looking for.

    3) The Randomized Precipitation controls this so technically yes. The higher you set the overall precipitation cap, the higher the chances of having higher precipitation intensities get.

    4) UniStorm's moon will continue to cycle through regardless of the calendar date. UniStorm has an option for a custom calendar so you can make months as long as you'd like.

    5) The moon's path through the sky is constant and doesn't change depending on the moon phase.

    6) It should be possible to add your own custom time system. However, it would require some minor modifications to the UniStorm script. If your time is similar to DateTime, you would just need to convert your time to the format of UniStorm's. UniStorm's time has a max value of 1 where 0.0 would be midnight and 0.5 would be noon. You can convert your time by using the following equation: ConvertedTime = YourHour / 24 + YourMinute / 1440

    7) Auroras are a weather type that we certainly plan on adding soon. Our last update improved the quality of the particle effects. Now that this has been done, we would like to add new weather types and Auroras the top on our list.


    It sounds like the Asset Store isn't properly updating your UniStorm asset, which is an Asset Store bug. Following the tutorial here should allow your UniStorm asset to update: http://unistorm-weather-system.wiki..._in_my_project_still_hasn.27t_update_properly

    Also, have you tried getting a new UniStorm system using Window>UniStorm>Create Weather System? I don't think individual prefabs are updated with updates.
     
  29. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    Hi there, I've searched all over the place for an answer to this but none of the solutions are working. I'm trying to get fog working with uFPS and Unistorm on Unity5.5 with no luck. Any help on getting this working would be great, thanks.
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    Have you made sure that you've update your Image Effects to the Unity 5.5 versions? This can be done by reimporting the Image Effects using Asset>Import Package>Effects.
     
  31. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    Hi there, yup I've tried that with no luck. Thanks.
     
  32. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    If I remember correctly, there may be a minor bug with UFPS and Global Fog. However, there is a workaround for it. I believe if you add the Global Fog image effect on both cameras, it should allow you to properly have Global Fog.

    If you need more info on image effects and UFPS, there is a discussion about it here: http://www.opsive.com/assets/UFPS/forum/index.php?p=/discussion/3588/image-effects
     
  33. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    I'll create a message with them as well, as that doesn't work either. Thanks for your help though. When I add global fog to the main camera the clouds disappear. When I add it to the weapon camera, it just doesn't show anything fog wise. When it's on both, the clouds disappear and nothing related to fog works.
     
  34. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    I was able to get it working I think, but on a clear sunny day, the fog still encompasses the sun and you can't see it. Is that normal?

    After looking at your demo scenes, it appears I see the same issue there. Could you check out your demo scenes on Unity 5.5 and let me know if that's how it's supposed to look? It makes it hard to see the actual clouds and sun, the sky gets overtaken by fog even on clear days.

    I tried your two camera demo, and the basic demo C#

    Here is a screenshot of my scene on a clear day at noon, staring at the sun:



    Thanks
     
  35. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    The only time the Global Fog blocks UniStorm's sky is when the Global Fog image effect is outdated. This happens when using the old image effects with Unity 5.5. You stated that you've already updated your image effects to Unity 5.5's so I will look into this for you to see if I can figure out what's going on. If I find a solution, I will be sure to post it here for you.
     
  36. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    I apologize... I just re-imported them again and it fixed the issue. I had imported other assets today that must have overwritten that again. Thanks for all of your help tracking this down!
     
  37. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    Hellooo BHS,

    In version 2.3.1 is not possible change skybox in day or ground color ;( - unity 5.5.2
     
  38. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    No worries, great to hear everything is working for you.

    Hey there!

    This isn't UniStorm, it's Unity's Global Fog. You just need to reimport your Image Effects so they are Unity 5.5's version. This can be done by going to Assets>Import Package>Effects in Unity. This should fix the issue you're having.
     
  39. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    @BHS

    thanks for reply, hmm but now i think is in my player , your scene demo is good now, but no in my project - i have UFPS
     
  40. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    If you are using UFPS, you have to apply the Global Fog image effect to both cameras.
     
  41. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    The only way I was able to get fog working with uFPS in Unity 5.5 while using Unistorm was to only have the global fog on the main camera not the weapon camera.
     
  42. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    If you are referring to the sky staying blue at night, this is Unity not UniStorm. You need to apply UniStorm's sun to Unity's Environment Light setting. This can be done by following the tutorial below. It only takes a few seconds. http://unistorm-weather-system.wiki...My_Sky_gets_bright_.28and_or_blue.29_at_night
     
  43. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
  44. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    @BHS

    now i dont have more sun, in version 2.1.4 100% good and now 2.3.1 no more work fog Hide the sun in mostly clear, in all demo
     
  45. HolyFireGames

    HolyFireGames

    Joined:
    Apr 23, 2014
    Posts:
    134
    If you're using Unity 5.5 re-import the standard asset image effects. That's what fixed it for me.
     
  46. anunnaki2016

    anunnaki2016

    Joined:
    Jun 16, 2016
    Posts:
    93
    thanks my friend i go try

    Edit: Nothing change, ;(
     
    Last edited: Feb 26, 2017
  47. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    If the fog is hiding the sun then you need to update your Image Effects to Unity 5.5. If this isn't working, try deleting the Image Effects folder and reimporting them. Make sure that you don't have any compile errors in the Unity console or your scripts won't properly update.
     
  48. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    The script you posted has a minor mistake. The uniStorm variable should be UniStormWeatherSystemScript. You need to create a new script for it. The example the user posted wasn't a complete script. They were just demonstrating one method of accessing UniStorm's temperature. Create a new script using the following:

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class UniStormTemperature : MonoBehaviour
    6. {
    7.  
    8. private UniStormWeatherSystem_C UniStormWeatherSystemScript;
    9.  
    10. void Start()
    11. {
    12.     GameObject UniStormWeatherSystemObject = GameObject.Find("UniStormSystemEditor"); //Find the UniStorm GameObject
    13.     //Assign the UniStorm script as a script object so you only call Get Component on start once
    14.     UniStormWeatherSystemScript = UniStormWeatherSystemObject.GetComponent<UniStormWeatherSystem_C>();
    15. }
    16.  
    17. void Update()
    18. {
    19.     if (UniStormWeatherSystemScript.temperature >= 33)
    20.     {
    21.          Debug.Log("It is above freezing");
    22.     }
    23.     if (UniStormWeatherSystemScript.temperature <= 32)
    24.     {
    25.          Debug.Log("It is below freezing");
    26.     }
    27. }
    28. }
    29.  
     
    Last edited: Mar 1, 2017
    macabremortuary likes this.
  49. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Sorry! I'm using an out of date version of UniStorm - will update when I have a chance. Apologies again :(
     
  50. GOLDY00

    GOLDY00

    Joined:
    Mar 16, 2013
    Posts:
    139
    Stormy with that script how can I make it so it does camera effects at certain points say when it's to hot enable cam effect for hot or too cold enable cold effects