Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by PogyManTV · Mar 28, 2016 at 12:52 AM · networkingcolorlerprpcskybox

RPC Color.Lerp

So i made my TOD(time of day) script work through network but i encountered to the folowing problem my skboxes or color of the sky changes as the time pass by for this i used Color.Lerp when iam hosting some game i can see how smoothly sky changes. But when iam playing as a client skyboxes does not lerp they just change from one color to another without smooth. I am so confused right now because i don't know what exactly to do. And also ia have another problem i don't know how to change light Intensity through network i tried rpc call but it didn't work. I am attaching also my TOD script here : using UnityEngine; using System.Collections; public class TimeOfDay : MonoBehaviour { %|326528793_1|% %|1349614966_2|% public float Hour = 14; %|825521709_4|% public Light sun; %|744680064_7|% %|-1353448817_8|% %|-1400358258_9|% %|516075851_10|% %|474590980_12|% public Color DuskFogColor; public Color MorningFogColor; %|131711687_15|% %|1544107518_16|% public Color NightAmbientLight; public Color DuskAmbientLight; %|-1458133773_19|% public Color MiddayAmbientLight; %|-527775879_21|% %|843871461_22|% %|1706357192_23|% %|1376173752_24|% %|-42259459_25|% %|297837856_26|% %|1271815733_27|% public Material SkyBoxMaterial2; %|1104761904_30|% %|-820288095_31|% %|877957198_32|% %|-647247510_33|% %|-416881083_34|% %|-1085665453_35|% %|1545882607_36|% %|-140153543_37|% %|-1243984715_38|% void Start () { %|-770558535_41|% } %|319604241_43|% %|346792142_44|% %|223938316_45|% %|835420831_46|% %|1264280838_47|% %|-1195298554_48|% %|1806624139_49|% } %|2042673305_51|% %|103382514_52|% networkView.RPC ("SoundNight", RPCMode.AllBuffered); %|-1767032627_54|% %|-842653949_55|% { networkView.RPC ("SoundDay", RPCMode.AllBuffered); %|-1148583551_58|% if(Tod>8&&Tod<10) %|2069481542_60|% %|345656225_61|% } %|-439530568_63|% %|1255576148_64|% } %|-1815196618_66|% %|-2054130026_67|% if (slider >= 1.0) { slider = 0; %|-1810667023_70|% slider = GUI.HorizontalSlider (new Rect (20, 20, 200, 30), slider, 0, 1.0f); //if (nView.isMine) //{ %|-2140293936_75|% %|-2000008057_76|% %|-1862995920_77|% %|1227279016_78|% %|-82782536_79|% %|-111995997_80|% if (slider < 0.5) { %|1134835035_83|% } if (slider > 0.5) { %|-695415770_86|% %|-1736335212_87|% %|-556922883_88|% %|-1175558066_89|% Tod = slider2 * 24; %|-792815660_91|% %|1959657838_92|% //it is Night if(Network.isServer) { %|481282465_96|% %|-372285317_97|% } %|2100168505_99|% %|-1701426148_100|% %|-986892620_101|% networkView.RPC("Time2", RPCMode.AllBuffered); } %|-506540136_104|% %|-283460589_105|% } if(Tod > 6 && Tod < 8){ %|-315200488_108|% %|226254305_109|% networkView.RPC("Time3", RPCMode.AllBuffered); } %|1547193916_112|% %|464623576_113|% if(Tod > 8 && Tod < 10){ %|1488794818_115|% { networkView.RPC("Time4", RPCMode.AllBuffered); %|1409637401_118|% %|1618911362_119|% %|683871677_120|% %|663321042_121|% %|158325286_122|% %|874094169_123|% %|-396061983_124|% RenderSettings.skybox = SkyBoxMaterial1; RenderSettings.skybox.SetFloat ("_Blend", 0); SkyBoxMaterial1.SetColor ("_Tint", NightTint); RenderSettings.ambientLight = NightAmbientLight; %|326022603_129|% %|-801683943_130|% %|16272582_131|% void Time2() %|1287144338_133|% %|-154084831_134|% %|276711894_135|% %|1841334842_136|% %|654238163_137|% %|814643437_138|% RenderSettings.fogColor = Color.Lerp (NightFogColor, DuskFogColor, (Tod / 2) - 2); %|2032913768_140|% %|-1002148889_141|% %|239772722_142|% { %|-105732807_144|% %|-1832035652_145|% RenderSettings.skybox.SetFloat ("_Blend", (Tod / 2) - 3); %|-1376045994_147|% %|-179158054_148|% %|-1996512808_149|% %|-405354034_150|% %|345631957_151|% %|-2067621348_152|% %|-1411131234_153|% RenderSettings.ambientLight = MiddayAmbientLight; %|188098573_155|% %|-1593273208_156|% %|-1615252528_157|% %|-489316232_158|% RenderSettings.fogColor = Color.Lerp (MorningFogColor, MiddayFogColor, (Tod / 2) - 4); %|-632908362_160|% %|1779503957_161|% %|1893111644_162|% if(!nView.isMine) %|-345390626_164|% %|149891131_165|% %|-1659932826_166|% %|2054723808_167|% %|-1591218257_168|% %|-826837250_169|% %|-1296596952_170|% sun.intensity = (slider2 - 0.2f) * 1.4f; if(Tod>5&&Tod<7) %|-813450742_173|% %|164983298_174|% //sunObject.GetComponent<Light>().enabled = false; %|310784258_176|% %|504227966_177|% %|-522274925_178|% %|-322759266_179|% //sunObject.GetComponent<Light>().enabled = true; %|620094770_181|% %|-900683155_182|% [RPC] void SoundDay() %|1627691515_185|% %|1618099975_186|% %|-456081545_187|% clouds.SetActive (true); } %|1894286327_190|% %|1350940946_191|% { nightSoundObj.SetActive (true); %|95903840_194|% %|2136021176_195|% %|-1230236261_196|% }

Thanks for any help.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Null Pointer at RPC Call Unity Network 0 Answers

Client can't answer to Server, Command methods don't work, ClientRPC do 0 Answers

Simple ClientRpc Whats wrong with it? 0 Answers

ClientRpc s are not called 1 Answer

SyncVar works not always 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges