• 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 /
This question was closed Jun 03, 2015 at 03:34 PM by bobin115 for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by bobin115 · Jun 02, 2015 at 03:12 PM · java

main texture scrolling but not normal map

here is my current script:

 var scrollSpeed = 1.0;
 var MainoffsetX = 0.0;
 var MainoffsetY = 0.0;
 
 var UseCustomTex = false;
 var CustomTexName = "";
 
 function Update () 
 {
     var offset = Time.time * scrollSpeed;
     if(UseCustomTex){
     renderer.sharedMaterial.SetTextureOffset (CustomTexName, Vector2(MainoffsetX*offset, MainoffsetY*offset));
     }
     else{
     renderer.sharedMaterial.SetTextureOffset ("_MainTex", Vector2(MainoffsetX*offset, MainoffsetY*offset));
     
     }
 }

this scrolls the main texture but not the normal map. what i would like to know is how i would go about scrolling both main texture and normal map at the same time.

cheers

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

1 Reply

  • Sort: 
avatar image
0

Answer by Binxalot · Jun 02, 2015 at 03:17 PM

Already answered: http://answers.unity3d.com/questions/59292/texture-offset-bump-and-main-color.html

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 bobin115 · Jun 02, 2015 at 03:23 PM 0
Share

thanks, however this is achieving the same thing but it is in a different context to my script i would like to know how i can do it not how other people can.

avatar image Rtyper · Jun 02, 2015 at 06:31 PM 2
Share

The concept is the same in both cases, specifically this line:

 cog.renderer.material.SetTextureOffset("_Bump$$anonymous$$ap", bOff);


You need to set the texture offset for both _$$anonymous$$ainTex and _Bump$$anonymous$$ap, so just copy and paste the line from your script that scrolls the main texture and change it to act on the bump map.

avatar image bobin115 · Jun 03, 2015 at 03:35 PM 0
Share

solved it thanks anyway

 renderer.shared$$anonymous$$aterial.SetTextureOffset ("_Bump$$anonymous$$ap", Vector2($$anonymous$$ainoffsetX*offset, $$anonymous$$ainoffsetY*offset));
 
avatar image Binxalot · Jun 03, 2015 at 06:19 PM 0
Share

that is exactly what he said to do.

avatar image bobin115 · Jun 04, 2015 at 06:50 AM 0
Share

it is similar not the same

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

21 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

Related Questions

How do I right this Java Script code in C# 1 Answer

New Ui buttons 1 Answer

Problem with call static methods in plugin 0 Answers

How to Instantiate prefab as child? (Java) 1 Answer

Sending bytes over network 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