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
0
Question by Rathanak · Oct 25, 2011 at 08:26 AM · animationiphone

make background run loop

how can i make background run and run in loop? i mean when game start player just have action at the sam place but backgrund is runner . so how can i let it run and loop on it?

Comment
Add comment · Show 6
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 CHPedersen · Oct 25, 2011 at 08:28 AM 0
Share

Errr... I'm afraid I don't entirely understand this question. Can you elaborate? Are you talking about running a process in the background, like a separate thread of execution?

avatar image syclamoth · Oct 25, 2011 at 08:41 AM 0
Share

Nope, we're talking about a looping, moving, background image.

 material.mainTextureOffset = some Vector2

Seriously, use the search function- this question has been asked at least twice in the last three weeks alone.

avatar image CHPedersen · Oct 25, 2011 at 08:45 AM 0
Share

Wow. Just, out of curiosity, how did you glean that from the question text alone?

avatar image CHPedersen · Oct 25, 2011 at 08:49 AM 0
Share

Oh, it's because you knew from previous questions...

avatar image syclamoth · Oct 25, 2011 at 08:57 AM 0
Share

I'd post a proper answer, but it's really basic, this guy can't upvote, and he never marks answers as 'accepted' either...

Show more comments

1 Reply

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

Answer by save · Oct 25, 2011 at 09:03 AM

It depends on what kind of background you have, if it's just a flat image then syclamoth's answer is a good solution. If it's several objects you can have them in two parented instances where you move the past instance when you're at the middle of the later one. This can for instance be done with triggers:

 /* Put this script on both objects */
 var otherBackgroundObject : GameObject; //The parent of the other instance
 private var bgWidth : float = 500.0; //The width of one background object

 function OnTriggerEnter (other : Collider) {
     if (!other.CompareTag("Player")) return;
     otherBackgroundObject.transform.localPosition.x+=bgWidth*2;
 }
Comment
Add comment · Show 1 · 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 Rathanak · Oct 25, 2011 at 09:16 AM 0
Share

Thanks you so much for you code.... :)

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity iPhone 2D Left Right movement 0 Answers

Need help with my animation script 2 Answers

Animation: Object distance determining frame? 0 Answers

Activate and Deactivate Animations With a Button Press 1 Answer

How to select an animation clip by index number? 7 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