« first day (3529 days earlier)      last day (1498 days later) » 

1:43 PM
Hello! Is anyone online ?
 
I'm not
 
lol
Im facing some issues with character resolution in unity
The character is getting distorted like this: prnt.sc/rsbs6o
How it should look like : prnt.sc/rsbt3b
But Im not sure how to adjust the Camera Field of view and to what value
someone please help. Thanks !
 
In this example, the 16x16 texel mushroom sprite has been scaled up to 17x17 screen pixels, and so the snapping happens differently from one part of the image to another, creating the ripple or wave that stretches & squashes it as it moves.

So, the trick is to adjust your camera size/field of view so that your assets' source texels map to an integer number of screen pixels. It doesn't have to be 1:1 - any whole number works great:

1:3 Scaling
that's the part you want
 
2:05 PM
And that's also the part I dont know how to implement
:/
 
user92578
Have you searched for "Unity pixel perfect camera"? That seems to be what you want if I understand correctly
 
2:27 PM
Questions to ask yourself:
1. How many texels tall is your sprite?
2. How many world units tall is it when placed in your scene?
3. How many world units of height does your camera see?
4. How many pixels tall is your screen?
Combining all these factors, we can work out the exact pixel:texel ratio, and identify what needs to change to bring it back to a whole number. So, which of these do you have values for, and which are you having trouble determining?
 
1. The sprite is 16 units tall and 8 units wide.
2,3,4 How do I get these values ? Im extremely sorry for those noob questions :| Im just starting out on unity.
 
Let's chip away at them one by one. Starting with point 2...
Is your sprite being drawn with a SpriteRenderer in your scene, or an Image inside a UI Canvas?
 
2:46 PM
@0xVikas BTW "chipping away" is how you solve most problems in game dev. :)
 
3:09 PM
@DMGregory its an Image
 
Ooh, that's an extra can of worms then. The UI features are powerful, but they include lots of places where you can adjust the sizing of your display elements, and any of those places can potentially affect your pixel:texel display ratio.
 
for the record, UI elements shouldn't be used for game objects.
they're not optimized for that kind of use.
 
I guess that's something we can look at: can you use a sprite renderer in your scene for this purpose, rather than making this element part of the UI?
 
Yeah I can do that
But can we try to just fix it with the sprite being just an image ?
 
Yes, but we'll need more information about how you've set up your canvas, and every container object between the canvas and your image.
 
3:24 PM
Actually im just following this video right here : youtube.com/watch?v=P98iXcpN9YQ
 
I'm not going to watch a YouTube video while I'm at work. We can help, but you need to explain.
 
I'm not particularly inclined to spend a lot of time helping someone do something the wrong way, particularly if doing it the wrong way makes it harder, i.e. more work for me.
 
Personally, I don't find "right way" and "wrong way" to be especially useful notions in game development. There have been lots of times when I've had good reason to do something "the wrong way" according to conventional wisdom, but at the end of the day, if it works, it works. ;)
Even if putting this in a Canvas wouldn't be my first choice as a dev, there are definitely cases where that's advantageous, so it's something we can solve. And there are some simple cases in the Canvas where it's even easier - we just need more details about what specific case we're dealing with.
 
right, but trying to get UI stuff to be gameplay elements is going to cause nothing but problems down the road.
 
Depends on the gameplay. If you're making a Bejewelled clone, it might make perfect sense for the whole gameplay to be in UI. ;)
 
3:40 PM
Well I'm trying to make a game like The Legend of Zelda. I actually figured out how to fix it. Thank you @DMGregory @Almo for trying to help ! And Im sorry for bothering you with stupid questions.
 
they were not stupid questions!
 
I'm glad you solved your problem! Answering questions is exactly what we're here for, so you never have to apologize for asking here.
2
 
Thank you! I Never saw a group like this where members actually reply to questions :)
 
Sorry we didn't get to an answer before you did. ;) Unity is a very flexible engine, so it can take a lot of background information to know what fix is appropriate for a given situation.
 
Im sure I will be back here soon to ask more questions, hopefully better ones
 
 
5 hours later…
8:52 PM
Yay! I can work 4 more hours per week :P
 
hahaha
 

« first day (3529 days earlier)      last day (1498 days later) »