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 /
avatar image
0
Question by Legrandes · Mar 02, 2016 at 06:31 PM · animationbackgroundcolor change

How Can we make moving background like in Magnets game ??

Hello everybody, i am trying to make moving background meanwhile changing color like in the game Magnets but i have no idea how to make it. Any ideas ??

alt text

screen480x480.jpeg (13.4 kB)
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 NickWu · Mar 02, 2016 at 06:41 PM 0
Share

can you be more specific? include a video or a gif? I can't really figure out what you want to do from a still picture

avatar image Legrandes NickWu · Mar 02, 2016 at 07:10 PM 0
Share

VIDEO

3 Replies

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

Answer by Graphics_Dev · Mar 02, 2016 at 07:23 PM

You need a UV scroller:

 using UnityEngine;
 using System.Collections;
 
 public class UVScroll : MonoBehaviour 
 {
     public float offsetX = 0.5F;
     public float offsetY = 0.5F;
     private Renderer rend;
 
     void Start() 
     {
         rend = GetComponent<Renderer>();
     }
 
     void Update() 
     {
         float offsetx = Time.time * offsetX;
         float offsety = Time.time * offsetY;
         rend.material.mainTextureOffset = new Vector2(offsetx, offsety);
     }
 }
 

Let me know if this helps ;)

Comment
Add comment · Show 3 · 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 Legrandes · Mar 02, 2016 at 07:45 PM 0
Share

Scipt is working good. But how can we change the color ? What kind of shader should we create?

avatar image Graphics_Dev Legrandes · Mar 02, 2016 at 07:51 PM 0
Share

Once again please leave as a comment just click add comment below answer or question you are responding to ;)

I would suggest asking a new question like "How can I change material color smoothly with C#?"

Try to keep each question to just one =)

Please mark my answer as correct to close this question.

avatar image Legrandes Legrandes · Mar 02, 2016 at 07:52 PM 0
Share

Sure. I will creaete the next question and would apreciate if you help me )

avatar image
0

Answer by phil_me_up · Mar 02, 2016 at 06:51 PM

Not totally sure what you're asking for, but shaders are probably what you're after. Using shaders you can scroll texture UV, change colouring etc.

They can be a bit confusing for beginners but if you want to make pretty games, they are essential.

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 Legrandes · Mar 02, 2016 at 07:09 PM 0
Share

Video of $$anonymous$$AGNETS GA$$anonymous$$E

Please take a look at this video . You can see how background changes the color and cubes are moving.

avatar image phil_me_up Legrandes · Mar 02, 2016 at 07:11 PM 0
Share

Yep, see my Shaders answer. That's the way to go on this.

avatar image Legrandes phil_me_up · Mar 02, 2016 at 07:17 PM 0
Share

Can you please show me an example ? video or link with info about it ?

Show more comments
avatar image Graphics_Dev · Mar 02, 2016 at 07:18 PM 0
Share

It really doesn't have much to do with shaders. Its like 3 lines of C# that adjust the material offset property.

avatar image
0

Answer by Jessespike · Mar 02, 2016 at 07:24 PM

Material.SetTextureOffset

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

72 People are following this question.

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

Related Questions

Preview a waveform in the animator 1 Answer

Can the animation editor create local rotational data? 3 Answers

How to change the color of a texture through an animation? 1 Answer

Adding animation clips via script 2 Answers

Is it practical to use videos as textures for the walls of a room? 2 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