Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
3
Question by Velketor · Mar 28, 2011 at 11:32 PM · rotateskyboxuvanimate

How do I Rotate a Skybox's Material

How can I rotate a skybox's material so it simulates slow movement of the sky? Does anyone have a script that does this? I have a script that can animate UV's but it won't let me apply it to a material or a skybox.

Below is the UV animation script...maybe someone can modify it to animate the UV's of a skybox?

//Scroll main texture based on time
var scrollSpeed = 0.5;
function Update() {
    var offset = Time.time * scrollSpeed;
    renderer.material.mainTextureOffset = Vector2 (0,offset);
    renderer.material.mainTexture.wrapMode = TextureWrapMode.Repeat;
}

Any help is greatly appreciated. Thanks!

Shawn

Comment
Add comment · Show 2
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
avatar image Justin Warner · Mar 29, 2011 at 12:01 AM 0
Share

Hey, by the way, the 10101 button up top is the code button =) thanks for attempting haha, hope you find something!

avatar image Velketor · Mar 29, 2011 at 01:35 PM 0
Share

haha ya I inserted my text inside the quotes for the code...but it kept refusing to properly format...do I need to do anything specific to get them formatted properly? thanks for your help, I appreciate it

4 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by DaveA · Mar 29, 2011 at 12:11 AM

This may interest you: http://answers.unity3d.com/questions/14461/how-do-i-make-a-moving-skybox

I'm pretty sure the Asset Store has a nice plugin for doing what you want.

Comment
Add comment · Show 4 · Share
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
avatar image Velketor · Mar 29, 2011 at 12:47 AM 0
Share

Thanks, but I'm not looking to spend any money. I appreciate the advice.

avatar image DaveA · Mar 30, 2011 at 11:29 PM 0
Share

And for the help I get downvoted? Nice.

avatar image Velketor · Jun 19, 2012 at 05:21 PM 0
Share

I didn't want to downvote you. =( This should have been an upvote. I do appreciate your help. I am sorry. It won't let me remove the downvote either. So I accepted it as a correct answer ins$$anonymous$$d. I hope you understand.

avatar image DaveA · Jun 27, 2012 at 03:50 AM 0
Share

Ah, thanks

avatar image
9

Answer by ConstantineM · May 21, 2013 at 03:01 PM

Sorry for digging up an old question that is also answered, but i would like to contribute my solution too.

What i did was to create a second camera, set the depth to be less than the depth of the main camera, at the main camera i set clear flags as "depth only" while the second camera would have clear flags set as "Skybox". then a simple script for the second camera's rotation and you get the effect that you want.

Comment
Add comment · Show 5 · Share
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
avatar image Lagalot · Jul 23, 2013 at 12:20 AM 0
Share

Thank you, I had no clue on how to do this until I tried your solution and it worked. I just created an account here to say thanks to you.

avatar image McNull · Jan 18, 2014 at 07:24 PM 0
Share

Wish I had rep enough to +1; Ty!

avatar image tochisan · Mar 21, 2014 at 06:12 PM 0
Share

Great solution! Easy and works well. FYI i had to set the camera's culling mask to nothing as well.

avatar image magicaxis · Apr 08, 2014 at 03:33 AM 0
Share

$$anonymous$$y god constantine that's brilliant! Why can i only upvote once?!

avatar image Airianna · Apr 14, 2014 at 07:48 PM 0
Share

Wonderful!

Except that I am having some issues with it while in mouselook... Trying to figure out a way to disable it moving with the main cam :)

avatar image
0

Answer by Justin Warner · Mar 28, 2011 at 11:43 PM

Of what I've read... You have skyboxes thought out wrong... It's not as easy as just moving it... Like clouds are very complex...

http://unity3d.com/support/documentation/Components/class-Skybox.html

I recommend reading up on it...

Also, this place has some good info on it:

http://www.unifycommunity.com/wiki/index.php?search=skybox&go=Go

But yeah, I'd rather you read it than I explain it wrong, but I might be wrong, but meh.

Good luck! =).

Comment
Add comment · Show 2 · Share
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
avatar image Velketor · Mar 28, 2011 at 11:55 PM 0
Share

Ya I've read all of those. I've looked everywhere. I understand Skybox's and the multiple ways to create them. I just don't know how to animate the actual textures of the skybox to simulate movement. Thanks for the links though, I appreciate it.

$$anonymous$$

avatar image Justin Warner · Mar 28, 2011 at 11:57 PM 0
Share

http://answers.unity3d.com/questions/14461/how-do-i-make-a-moving-skybox That might help... Also, I remember reading something of a group making like, a cloud package that lets you add in moving clouds and stuff... I had it a while ago, lost it last crash though, BUT, you also have to tweak the cameras, they made it a little hard to work out, but I got it in like 20 $$anonymous$$. Just aggravating... $$anonymous$$aybe you can find it?

avatar image
0

Answer by blueknee · Oct 03, 2016 at 06:01 AM

It's fairly simple actually.

If you are using built in "Skybox/6 Sided" shader, modify "_Rotation" property.

 Skybox skybox;
 
 void Update()
 {
     skybox.material.SetFloat("_Rotation", Time.time * 10);
 }   

If you want to do it with cubemap, copy and paste the code from built in shader "Skybox.shader" available in unity archives.

Comment
Add comment · Share
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

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

rot not working for 2nd prefab 2 Answers

How do I animate a texture to rotate and loop around an imported object? 1 Answer

UV mapping 5 Answers

How could I make this script run a bit smoother (iOS)? Any Ideas? 1 Answer

How could I write a script to flip pages of a book? 1 Answer


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