• 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 stefansmara · Feb 22, 2017 at 12:12 PM · unity 5gameobjectinstantiate prefabprefab-instancescipting

How to display gameobject(prefab folder) as image?

Hi guys.I'm new here.I develop a fishing game.I have in prefab folders a lot of fishes.I go fish , i catch , increase score etc. but i want to display in a corner last fish that i catch.How can i do that? There is my code :

 if (Sansa == 1) // rechin
         {
             RoosterAnimC.Play("Main|Ridicare_Undita");
             LabelButon.text = "";
             ComponentaButon.interactable = false;
             yield return new WaitForSeconds(10);
             PestePrins = (GameObject)Instantiate(Peste.gameObject, PunctIntrare.transform.position, PunctIntrare.transform.rotation);
             NrPesti.text = (System.Int32.Parse(NrPesti.text) + 1).ToString();
             Score.text = (System.Int32.Parse(Score.text) - 70).ToString();
            // TextNotificare.text = "That’s not a demo. Give me your money!";
             TextNotificare.text = getRandomMessagefromRechin();
             Debug.Log(PestePrins);
            
             ReplicaPeste.text = "";
 
 
             yield return new WaitForSeconds(10);
 
         }

PestePrins means CatchedFish in english.I translate because i'm from Romania and i want you to understand my variable names. I instantiate PestePrins as gamobject. If u notice , a few rows down , i Debug.Log(PestePrins) , i dispplay my catched fish . How can i display it in a corner as image ? Or display anywhere for this moment.I don't find anything to help me on internet. I'm newbie by the way. Thanks for helping me,have a nice day! :)

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

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

Answer by Zee-Play · Feb 22, 2017 at 01:10 PM

There are two ways to do this:

1 - Create an image of each fish that you have into a JPG or PNG (if you need transparent background), and use Canvas-Image where you replace the Source Image with your rendered ones based on what fish you catch. Can draw your own images, or render them via 3d software.

2 - use Render Texture, and have a second camera positioned somewhere off screen where your fish models will load in front of it. The rendered texture will again be assigned to a Canvas-Image, and make sure your render texture camera has a cooling mask so it can only see the fish. This option will allow you to have your fish in the corner of the screen also animated.\ https://www.youtube.com/watch?v=pA7ZC8owaeo

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 stefansmara · Feb 22, 2017 at 01:15 PM 0
Share

Hmm , pretty hard for me :( i'm newbie.$$anonymous$$y problem is how can i do this in script? Thanks anyway , i will try ur method :)

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.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

GameObject.Find not finding game objects in the scene? 2 Answers

Key Arrows into Swipe Input 0 Answers

Move Rigidbody along curve 1 Answer

Model not rendered on Android Lollipop 5.0.1 0 Answers

Rotation of instantiated clone based on prefab, when using another object's rotation as parameter in instantiate method. Why is that so 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