Lizard and grass Unity world unit

Hi all,
I’m having a problem with the world unit and the Lizard.
In the lesson we move the lizard 1 in the x plan , I need to move in 100 of 150… why?
Some more scale related issues occurred along the lesson, whet we scaled the canvas to 0.0075, in my unity it got impassible to see (way to small), so I scaled it to 0.75.
Also I use my own spreadsheet for the animation , its sat to 5 pixel per world unit ( I tried allot to play with that parameter and changes the spreadsheet may times make it feet the grass unit … no luck).
I also use own asset for the grass but I kept it the same size as the lesson Grass asset.
Any idea what is differed in the scales in my unity ? Where did I got wrong with the calculations? What should I check?
Thanks Dror.

Hello Dror :slight_smile:

In the lesson we move the lizard 1 in the x plan , I need to move in 100 of 150… why?

If you look at your own comment, you’ve kind of answered this question. If you take your scale of 0.75 and divide it by 100 you end up with 0.0075 - because you scaled differently, you now need to move more.

Some more scale related issues occurred along the lesson, whet we scaled the canvas to 0.0075, in my unity it got impassible to see (way to small), so I scaled it to 0.75.

I am assuming you are referring to the scene view? If so, just zoom in :slight_smile: If you have a mouse with a scroll wheel rolling it forwards should do that.

Rob!!! HI!!
I think I didn’t explain the situation right. I will try to divide it to 2 questions :

  1. Why the position in hundreds and not in singles?

  2. And the real problem is when I try to move the player on the grass, I want to move in the X and Y equally, as explained in the lesson. but that what happens:


    One world unit = 150. I want it to be 1 (so it will be easer).The issue is concerning to the “pixel to world unit” of the Grass or the Player… but I can’t fix it.
    What do you think?
    Thanks again.
    Dror.

Did you set your background image as a Texture or a Sprite?

the Bg is a texture on a UI Plane (p.s- I edited the previse passage). It’s not off sync with the Bg, it’s 150 pre 1 world unit.

In the course the grass was added to a canvas. Scaling was used on it there.

Yes. In the curse the we scale the panel to 0.0075 ( I scaled it to 0.75 because 0.0075 was to small(I don’t really know why)) and the payer isn’t a chilled of the canvas so the canvas scale don’t effects him.

Have you set the pixels per world unit for each sprite?

Only on the player (i set it to 5, but even if i change it to 6 or 4, the pivot are in the same palace and it’s still act as 1 =150)
As for the BG, the PNG set to a Texture, can i change the “pixel per world unit” of it? I cant see the option after i set it to Texture.

If your project is build able, can you zip it up and it here so I can download it and have a look, it will be easier to see things.

DrorsGlitch.zip (5.8 MB)

I added the file . (Ignore the assets … i used a place holder for now :sweat: )

Can’t open it. Are you using a PC?

yes :cry:
What file format will be good for you?

I’m on a PC also… .zip would be fine… not sure why it won’t open it… it reports that it is invalid.

Maybe try zipping up again and uploading again…

try to change the file to RAR.

You’ve bundled up an executable…

It’s the project I’m after… so that I can run it in Untiy and see what is what.

dp.zip (3.1 MB)

Sorry . I attached the project package ( i removed the sound folder to reduce the package size, i don’t thin it will cause any problem) , and switch it back to rar.

Hi @Dror_Davidovich,

Ok, here’s a video on how to resolve the issue, probably best to click the Full Screen button…



Steps in text also;

  • select LevelCanvas in the Hierarchy
  • within the Inspector, change the Rect Transform’s scale to 0.0075 for both X and Y
  • click Apply (I didn’t do this in the video, I only changed the instance not the prefab)
  • within the Project view, select PNGs
  • select enemy1
  • within the Inspector, click on the Sprite Editor button
  • note how your sprite sheet has slices the sprites at the size of 600 x 600
  • close the Sprite Editor
  • within the Inspector, change the Pixels Per Unit to 600 (as per the sprite size)
  • click the Apply button (I didn’t do this in the video either, but when I moved away to another object it prompted me to apply the changes)
  • on the Menu, click Edit and then select Snap Settings…, check that both X and Y are set to 1 (I didn’t do this in the video, I had already checked)
  • within the Hierarcy, select enemy1
  • select the Transform tool on the Toolbar
  • hold down the CTRL key and move the the horizontal transform arrow to move enemy1 back and forth across the screen, snapping to 1 world unit
1 Like

Thanks .
So we got 2 issues

  1. the LevelCanvas size- I tried to change LevelCanvas - when i enter in the scale 0.0075 it’s getting to small that i cant even zoom in. How can it be? Maybe an Unity setting ? a Bug?
  2. The enemy- it’s make since . i made him the make size as the BG texture. so his size (600pixel) in 1 Unity world unit ! great!

I did it!!! I zoomed in first and then changed the scale!!!
Yeeeee!!! Thanks!!!

1 Like