Forum rules - please read before posting.

Problems linking custom pixel perfect UI

Hi everyone!

I'm making a pixel art game, and I recently managed to make it pixel perfect with the PixelPerfect2D camera. The problem is that I want to make a camera-rendered UI so that it is pixel perfect as well, but when I link it to adventure creator (following this tutorial https://adventurecreator.org/tutorials/creating-inventory-bar-unity-ui) it does not work as expected:
Basically, it sends my UI elements far away from the camera viewport and messes up their interactability whenever I manage to get them on screen. The idea is to make a pop-up menu like the one in MI3, but making it stay true to the pixel size of the elements in the worldspace.
Please mind I'm pretty new to AC and Unity, so if you know any solution through scripting I'm all for it as long as I can understand it.

Thank you!

Comments

  • Welcome to the community, @mad_lemon.

    As you're using a separate asset to render the camera, I'm not sure where the source of your issue lies. Sharing full-screen screenshots of your project to illustrate the issue will help a lot to understand the problem better.

    You can set your Canvas's Render mode to Screen Space - Camera to have it render in camera space. However, there is currently an issue with this option when the Canvas also has a Canvas Scaler component. A fix for this issue is set to be included in AC's upcoming v1.66 update, which will be out soon in the new year.

  • Hi Chris, and thanks for the fast response!

    As you said, I am already using the Screen Space - Camera render mode, but I'm also using a Canvas Scaler so that might be at least one of the causes.
    May I ask what screenshots would be more useful to help understand the problem (i.e. the AC menu editor, the UI prefab...)? Just so I don't spam everyone with loads of unnecessary captures.

    Thank you again, both for your help and for developing AC. It really is a wonderful tool. And have a great year!

  • @mad_lemon Check out my wiki page for pixel-perfect camera space UI stuff: https://adventure-creator.wikia.com/wiki/Unity_2018.2_Pixel-perfect_camera - even I have to refer to my own guide to remember how to get this all working, and I'd recommend you follow the tutorial just to get the basics of how everything will work. There's a custom canvas scaler project in there you can use which will help, and the tutorial describes how to set everything up. Hope it helps!

  • If your UI works without the Canvas Scaler component, or when not using "Screen Space - Camera", then I'd recommend holding out for the v1.66 update to see if the positioning issues are addressed.

    If not, let's revisit this thread - screenshots of your Menu Manager's menu properties panel, the Canvas prefab Inspector, it's Inspector at runtime and the view from the Game/Scene windows if it comes to that.

  • @zebbi You're the one behind it? It's what I've been using so far to set everything up! I'd never be where I am without your help. I didn't manage to get your UI tutorial working though... might have to redo it to see if I missed something.

    @ChrisIceBox It does work indeed, so I think I'll hold up for v1.66 as you say.
    I may, however, include captures in another comment to see if there's anything that can be solved before it is released. Thanks again!

  • edited January 2019
    @mad_lemon hehe, yeah, I've updated it just recently to try and help one of the commenters out (you?) and I'll eventually try and update it with non-square pixels if Unity ever get the viewport raycasting fixed. I'd also like to eventually add textmesh integer positioned characters so there's no pickled looking text if it's used in camera space, but I haven't worked out how yet 😁

    I know many AGS converts need pixel-perfect art and the package by Unity is the only one I know of so far that works with AC, hopefully more converts will find use in it and we can get more retro AC games being made! 😀

    PS: I want to add that Chris has been incredibly gracious and helpful with getting subtitles to work with camera space, hopefully 1.66 will solve the issue!
  • @zebbi Yup that's me, but I forgot to update it, because it was basically a problem of me being dumb :s : I had two scripts with the same code. As I said I'm pretty new to Unity so this kind of mistakes happen usually, as well as having existential crisis behind the keyboard whenever something keeps going wrong.

  • Don't worry, I'm the worst coder in the world and I hadn't even used unity until the beginning of last year, we all have to start somewhere! I feel like throwing it in on a weekly basis but Chris is so helpful and the community on discord is super encouraging, there's always some motivation to keep building something awesome with AC!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.