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 AmerJongleur · Oct 18, 2017 at 10:16 AM · uiguiworldspace

How to handle UI/Space mixed scene?

Hi everyone!

I'm having these interrogations about my main scene setup.

1) My whole scene that you can see below is fully UI/Canvas-driven so it can adapt to different screen resolutions. 2) I need the background to take the whole screen. 3) I have a character that will live and behave in the center part, i want the UI to act like walls on bottom/top and sides. He has physics and rigidbody2D. 4) He is imported as a unity prefab from spriterPro, by default rendered with SpriteRenderer and Animator. So i don't know if changing him into UI will not break all of his animations. He now appears behind the background (because it is UI and renderer on top)

What would be the best method to have my character rendered before the background, behind all the other parts while keeping his all his physics properties? (His pathfinding is also world-space driven)

Thanks you!

alt text

alt text

mainscene.png (460.6 kB)
mainscene54.png (391.6 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Harinezumi · Oct 18, 2017 at 10:35 AM

I recently tried to do something similar and in my opinion you shouldn't try to use UI for 2D graphics, they are very different things.

What I'm saying is that the background, your character, everything that is the game world should be 2D sprite based, and only the buttons should be UI (it is just logical if you think about it).

Of course with this you get the problem of different screen sizes, but because you have some nice objects that are borders to your scene you can just cover up different amounts of the screen with that.

Hope this helps! Feel free to ask if something isn't clear!

Btw, I like the style of your game!

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 AmerJongleur · Oct 19, 2017 at 07:41 AM

Thanks for the reply. Yeah i understand your point but resizing is really working smoothly with this setup for the surrounding elements. Plus it's acutally UI/world scene mixed element since they will have buttons and interactible elements on it while acting as world scene borders.

There was a Unity option made for this actually, which is the render mode Screen Space - Camera in the canvas. It seems to do exaclty what i wanted, spatialize the UI elements in world space/camera space while keeping its UI rendering and resizing properties. I just had to add colliders on my borders after that and there it was, working! I'll make the background and character sprites and handle their resizing via scripts.

Thank you, appreciate it! Have a nice day!

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

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

World space buttons and preventing UI touch passthrough 0 Answers

3rd party UI - World Canvas or Screen Space Camera? 0 Answers

Can worldspace UI Elements cast a shadow? 1 Answer

Fade logo before main menu 2 Answers

Not-UI elements (3D models/particles) in UI system 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