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 Afassolas · Nov 13, 2014 at 08:02 PM · instantiatepixelation

How to improve the quality on an image game object that is bad when i instantiate it?

I have a sprite game object with an image which i want to instantiate to three positions. I use this

 public GameObject people;
     Vector3[] positionArray = new [] { new Vector3(10.362f,-2.2677f,0f), new Vector3(15.874f,10.257f,0f), new Vector3(-24.073f, 7.8497f,0f) };
 
     // Use this for initialization
     void Start () {
         // create an array of points for the people to be spawned
 
         people = GameObject.Find ("Cube");
         RandomPlace();
     }
     
     // Update is called once per frame
     void Update () {
     
     }
 
     public void RandomPlace() {
         
 
         GameObject obj = (GameObject)Instantiate(people, positionArray[Random.Range(0, 3)],people.transform.rotation);
 
         
     }

but when the game object is instantiated its quality is not good, kind of pixelated at the edges. What is causing this ? I use unity 4.6

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 MrSoad · Nov 13, 2014 at 07:11 PM 0
Share

If it looks the same when you display it in your scene as a test while not running the game then it is probably to do with your texture import settings. If so select your texture in whatever folder you have it in and have a play around with the $$anonymous$$ip $$anonymous$$ap, Compression, and Ansio settings to see if that resolves your issue.

(Assu$$anonymous$$g that sprite textures are subject to the same sort of import settings that other textures are, if not apologies...)

avatar image Afassolas · Nov 13, 2014 at 07:39 PM 0
Share

I have noticed now that many clones of the GameObject people are created even though I have no loop to create many instances of the game object.

if i pause the scene and I try to move the game object there is another (clone) under it and all these clones distort the original image.

Any ideas?

avatar image MrSoad · Nov 13, 2014 at 08:01 PM 0
Share

No, as far as I can tell you are only calling the Instantiate code once from Start(). So you should only be creating one people object...?

Are you calling RandomPlace() from any other scripts at all?

avatar image Afassolas · Nov 14, 2014 at 06:03 AM 0
Share

No RandomPlace() is on the same script

avatar image IEMatrixGuy · Nov 14, 2014 at 06:03 AM 0
Share

Do you have the script on multiple objects, which may be getting called repeatedly? This would be my best suggestion :/

Show more comments

1 Reply

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

Answer by Afassolas · Nov 14, 2014 at 06:04 PM

I solved this. It needed to have the script attached to another game object that would instantiate the "Cube", otherwise each new instance of Cube was running the Start() method again and was creating another clone going into an infinite loop.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Checking if object intersects? 1 Answer

Instantiate at run time or previously then make active? 1 Answer

How do I fix this error code: BCE0023: No appropriate version of 'UnityEngine.Object.Instantiate' for the argument list '(System.Collections.Generic.List., UnityEngine.Vector3, UnityEngine.Quaternion)' was found. 2 Answers

Instantiate as a child? 3 Answers

Instantiate ground/enemies 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