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 Barzona · Jan 28, 2019 at 03:00 PM · 2d camera

Can you project a camera texture onto a 2d object instead of a 3D object?

I've been working on this system where I record my mini games in pieces with cameras, but the only way I've found out how to project them is to create the render texture and dragging them onto a quad.

Normally, this would be just fine, I think, but my game is in 2D and plays in a 2.5D fashion and it specifically utilizes sorting layers, sorting order, and z positions to organize everything. I've been trying to get the quads to fall into line somehow, but anytime I mess with their z position, things get really messy. it would be best if I could have a 2D sprite house the render texture so I could organize it like any other 2D object in the scene.

I've found very little about this online. Some hints pointed to raw image, making a material with the render texture as a texture and putting that on a sprite, but nothing has worked so far.

Thanks for any advice!

Game so far:

https://www.youtube.com/watch?v=9dzxUfK-J_I&feature=youtu.be

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by KISP · Jan 28, 2019 at 03:17 PM

I'm currently doing that in my project without a quad. I left my render texture in my Assets folder, set my camera to render to it, and then dragged the render texture itself (not a material based on it) to the Texture spot on a Raw Image UI script. That should be enough to get it working, but you may need to muck around with the parameters.

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
avatar image
0

Answer by Barzona · Jan 28, 2019 at 06:23 PM

I have tried doing that myself, but it wasn't visible. Would you mind sharing some of your parameters? Can it be sorted like a sprite? By that I mean, access to both the sorting layers and sorting order?

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 KISP · Jan 28, 2019 at 06:46 PM 0
Share

Well, apparently I can't upload images. Here's the parameters:

Dimension: 2D Color Format: ARGB32 Depth: 24 bits with stencil sRGB: Off Dynamic Scaling: off

It's not a sprite, so I don't believe you can use sort order on it. Where in the UI (back, front, etc) are you trying to render it? You might be able to achieve the same effect by changing the render queue of the material or using a mask.

avatar image Barzona KISP · Jan 28, 2019 at 06:48 PM 0
Share

Im not at my computer right now. Is there a way to render this camera texture onto a sprite? That would literally solve everything.

As to where I tried rendering the raw image, I just dragged it onto the stage like anything else. Hmm

avatar image KISP Barzona · Jan 28, 2019 at 06:54 PM 0
Share

I'm not aware of any way to do it, but you could try using Sprite.Create and create the sprite from the render texture's texture at runtime. Would be a pain though if you want to be able to position things in the editor. Sorry, I meant what place would the render texture take in your sort order? If it's behind or in front of everything, you can probably achieve that by changing the material render queue.

avatar image
0

Answer by TheLastVoidMage · Apr 08, 2019 at 12:40 AM

I found this video and it really helps. https://www.youtube.com/watch?v=28JTTXqMvOU

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

100 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 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

How to stop a camera panning at level boundaries while zooming? 2 Answers

2D GAME (non UI object) for every pc resolution 0 Answers

Ortographic camera movement using mouse 0 Answers

2D Camera Script 2 Answers

2d Top Down Camera Movement Causes Tiles and Other Sprites to Blur\Ghost\Jitter 3 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