#๐Ÿ–ผ๏ธโ”ƒ2d-tools

1 messages ยท Page 5 of 1

thorn star
#

oh ok cool, how would i add padding to them then?

solemn latch
#

The flipbook works by manipulating the UVs.

thorn star
#

ok, that make sense

solemn latch
#

Generally, you edit either the texture or the mesh to have the UV borders have a bit of space to avoid bleeding

thorn star
#

ok, which do you reckon would be easier/better, editing the mesh or the texture?

solemn latch
#

This is assuming you followed the earlier advice from Fogsight?

#

And changed the texture settings?

thorn star
#

I have no clue, i hope so though

solemn latch
#

Since they are just squares, I'd edit the shader to shrink the area of texture it is capturing a little

thorn star
#

ok, and how would i do that, im not the best with shadergraph sorry lol

solemn latch
thorn star
#

ok cool!

solemn latch
#

Basically, pixels are interpolated so anything RIGHT on the border will have leakage.

thorn star
#

sometimes left though aswell, it depends on the mesh, and the order of the sprite atlas

thorn star
#

hmm, nope not working, weird

#

oh it does

#

ish

#

1e-05 scale gets rid of the leakage

#

but causes this...

#

going below -1, or above 1, has unusual consequences

solemn latch
#

You really should need only the tiniest offset

thorn star
thorn star
#

(now how do i mark a forum post as solved?)

radiant granite
#

In the tile palette editor can I add components somehow to tiles? So certain tiles would always have some component?

#

(I have a component that controls graphical effects for example)

elfin sandal
#

U will have to learn scriptable tiles

#

Or use gameobject brush for a quick and easy solution

solemn latch
paper pendant
#

damn asperite is a dream, but pixel animation is still pain and suffering

modest cargo
#

Even if a problem would feel dumb in retrospect, it may turn out to be a repeating stumbling block for different people

modest cargo
#

@radiant granite You should be able to pick a tile in "local" coordinates by adding the tilemap's world position to the chosen tile position
...If my vector math checks out

modest cargo
#

Could even have a specific Transform in the prefab denoted as the local origin, if you can't rely on the prefab origin for whatever reason or wish to move it easily

radiant granite
#

That is 0,0 apparently

#

I just want to have a standard layout for my tilemaps so I can generate maps with any one of them so I want to be able to access everything by it's index

#

I do tilemap.GetTile(new Vector3Int(0, 0, 0)); and I get that tile whihc I circled

#

I see absolutely no logical reason for it giving me that tile for 0,0

modest cargo
#

It's the world position of the prefab's Transform component

radiant granite
#

I see, so if I want to think about this in terms of the index inside the tilemap[ independent of the world coords I need to subtract(?) the transofrm coords of the tilemap

#

but then agian the transofrm is 0,0,0

modest cargo
#

That depends where in the scene the prefab is
You only need to add the offset position if it's not at the origin

radiant granite
#

Okay I will just slap a breakpoint in and checkk the numbers

modest cargo
#

(though the docs don't actually say if Tilemap.GetTile uses world coordinates or Tilemap's coordinates, I assume it's world)

radiant granite
#

I feel like the docs arent too clear on what is going on with tilemaps

#

But now, armed with a breakpoint, everything is at 0,0,0 I have no idea where it would go wrong

modest cargo
#

If you want tile at (1, 2) but the tilemap prefab is at (100, 100), then your tile should be got from (101, 102) which is the same as (1, 2) + (tilemap.transform.position)

#

Allegedly the tilemap system is a bit of a tech demo, like the 2D lighting

radiant granite
#

Ah

#

tilemap.transform.position is 0,0,0 as I expect sadly

#

Oh well it's okay I will goof around with it, dont want to bother you too much

modest cargo
#

I'm not totally sure what the problem is, but I hope this clarified at least a little
The positions are always coordinates, but you can treat them as indices pretty easily as 1 tile = 1 unit
add (.5, .5) to get to the center of the tile, just in case it's an issue of trying to sample intersections of 4 tiles

spring crypt
#

Hey yall, its me again xD. So, I set up two BG images to be parallaxed in my game, but when I press play and move my character around (I'm using cinemachine for the camera to follow my player), my backgrounds are static, they do not move at all. its like their position is locked or something

To be able to replicate them I set their draw mode to be tiled, Tile mode to continuous and I changed the mesh type to be full rect and the wrap mode to be repeat. Anyone have any idea why this is happening?

modest cargo
spring crypt
#

Here is a video of it

spring crypt
#

`` using UnityEngine;

public class Parallax : MonoBehaviour
{
public GameObject[] Backgrounds;
public float[] ParallaxSpeeds;
public Camera Camera;
public float Smoothness = 1f;

private Vector3 _lastCameraPosition;
private SpriteRenderer[] _backgroundSpriteRenderers;

void Start()
{
    _backgroundSpriteRenderers = new SpriteRenderer[Backgrounds.Length];
    for (int i = 0; i < Backgrounds.Length; i++)
    {
        _backgroundSpriteRenderers[i] = Backgrounds[i].GetComponent<SpriteRenderer>();
    }

    _lastCameraPosition = Camera.transform.position;
}

void LateUpdate()
{
    float deltaX = (_lastCameraPosition.x - Camera.transform.position.x) * Smoothness;
    for (int i = 0; i < Backgrounds.Length; i++)
    {
        float backgroundTargetX = Backgrounds[i].transform.position.x + deltaX * ParallaxSpeeds[i];
        Vector3 backgroundTargetPosition = new Vector3(backgroundTargetX, Backgrounds[i].transform.position.y, Backgrounds[i].transform.position.z);
        Backgrounds[i].transform.position = Vector3.Lerp(Backgrounds[i].transform.position, backgroundTargetPosition, Time.deltaTime * Smoothness);

        float leftBound = Camera.transform.position.x - Camera.orthographicSize * Camera.aspect - _backgroundSpriteRenderers[i].bounds.size.x / 2f;
        float rightBound = Camera.transform.position.x + Camera.orthographicSize * Camera.aspect + _backgroundSpriteRenderers[i].bounds.size.x / 2f;
        float spriteWidth = _backgroundSpriteRenderers[i].bounds.size.x;

        if (Backgrounds[i].transform.position.x < leftBound)
        {
            Backgrounds[i].transform.position = new Vector3(rightBound + spriteWidth / 2f, Backgrounds[i].transform.position.y, Backgrounds[i].transform.position.z);
        }
        else if (Backgrounds[i].transform.position.x > rightBound)
        {

``

#

``Backgrounds[i].transform.position = new Vector3(leftBound - spriteWidth / 2f, Backgrounds[i].transform.position.y, Backgrounds[i].transform.position.z);
}
}

    _lastCameraPosition = Camera.transform.position;
}

}``

modest cargo
spring crypt
#

oooh ok.

#

And should I be using the 2D camera?

#

or just virtual camera?

#

Yaay. Now it works! ๐Ÿ˜Ž ๐Ÿ‘ˆ. nice

modest cargo
spring crypt
#

But now I can't change the camera size, lmao it won't let me, its a little too big.

modest cargo
# spring crypt But now I can't change the camera size, lmao it won't let me, its a little too b...

Because your camera is being controlled by CM vcams
I like Cinemachine but it's a whole suite of tools, I don't really recommend it unless you're ready to study the documentation of how and why it works in detail
https://docs.unity3d.com/Packages/com.unity.cinemachine@latest/index.html The first 7 chapters are pretty important to not accidentally misuse the system
It's likely better to go with Pinballkitty's camera script and not worry about all that for now

spring crypt
radiant granite
#

I am going insane, it cant be world coordintaes since GetTile takes specifically int-s, and if I change the transform of the tilemap/grid/prefab I get the same tiles back

#

But it's just not indexed right

modest cargo
radiant granite
#

I think I've found something tho

#

The indexing does not run from 0, but after that it makes sense and I can get the cellBounds of the tilemap which is the lower left corner

#

And from there I can iterate the whole thing just fine

#

But it's no 0,0 but I need not care since I can get the start point

#

Oh hell yes, I can get the "bound" and just work with offsets from there

modest cargo
radiant granite
#

Well because the indexes dont start form 0

#

So I get the bounds and I can tream them "as 0"

#
 var cellBounds = tilemap.cellBounds;
 var x = cellBounds.x; 
 var y = cellBounds.y; 

 return tilemap.GetTile(new Vector3Int(x+1, y+1, 0));
modest cargo
#

I see!

radiant granite
#

This will get what I as a human would think is at "1,1"

modest cargo
#

That is useful ^^

radiant granite
#

Glad we figured it out, thanks

ancient ridge
#

why i cant see this obstacle?

#

its visible only when it not at ground

#

(im not good at english sorry)

ancient ridge
elfin veldt
#

OK I'm getting slightly ticked off now by Unity's tilemap system. I've created a sprite with all my tiles, but as soon as I move tiles in the source file or delete tiles the entire tile palette just becomes broken, because the tiles aren't in the same place anymore. So any painted tiles in my levels becomes another tile or just displays a red color for a broken tile... How are you supposed to change things if all your levels break if you make any changes to tilemap sprites? ๐Ÿ˜ 

pseudo shore
# ancient ridge

Did you change the sorting layer for your obstacle tilemap to be higher than ground?

pseudo shore
elfin veldt
modest cargo
elfin veldt
#

@modest cargo Ah, ye it does actually. I think I trim it on export.. ๐Ÿ˜ถ

#

So I assume these are the rules for working with sprites?

  1. Don't trim sprite on export
  2. Only replace tiles at specific locations if you want them replaced in the game with a new variant
  3. Use 'Safe' slice mode
  4. If expanding the sprite with more stuff, grow the canvas size in right and down directions

Anything else I should know about?

modest cargo
# elfin veldt So I assume these are the rules for working with sprites? 1. Don't trim sprite ...

That's about all I can think of
If the sprite slices in .meta file are always lost on resolution change it's better to start with plenty of empty canvas to begin with
I would also give each tile a 1px padding of the border pixel color (or later compile them into a sprite atlas which can be used to add padding also)
Not strictly necessary but sampling errors of adjacent pixels are super easy to run into

elfin veldt
spring crypt
#

Hey does anyone know what 3rd party tools are popular for editing tile sets? Is the built in unity one good enough to make simple side scrolling games?

elfin veldt
ancient ridge
#

why i cant see the player??

valid flame
#

When starting a 2d game, are all gameobject living inside a canvas or each gameobject has its main parents as a canvas?

modest cargo
valid flame
#

I wanna make a card prefab for a card game but that has to use sprites and such, but that has then to live inside a canvas to be visible

#

So it is a bit confusing

modest cargo
valid flame
#

So I should be making my prefab card with sprite renderers and not images? I'm a bit confused on how it work ๐Ÿ˜ž

modest cargo
valid flame
#

I think I'm doing it with just empty game objects adding sprite renderer on kt

#

Yeah reading it right now

modest cargo
#

You surely can do a card game using either but it's important to know about the limitations

valid flame
#

I've seen some tutorials but it's confusing

#

One goes full canvases the other full sprite render without reasoning on it

#

But maybe since I'll have to work with texts, canvases could fit

ancient ridge
modest cargo
ancient ridge
#

i cant see any object after tilemap

ancient ridge
viral moss
#

Hello guys can someone give me a hand I'm going crazy

I am doing this chess in 2d the problem is that it only works in the simulator when I create the build these are not shown neither in android nor in pc
It's like they don't load the prefabs, sprites, colors, etc.
The first 2 captures are the scenes in unity
When I build the build they should look like the other 2 screenshots
But in the created game they look like the first 2, it does not load anything that it creates

If anyone can give me some advice, I would really appreciate it.

vestal tusk
#

You want to make a mobile game?

zenith pier
#

Does anyone know how to put an image on top of another image ? Iโ€™m trying to put the character on top of the image of the maze, but when I do so the character goes behind the maze image and gets hidden

slim aurora
#

select your player

#

and add a new layer in the sprite renderer

#

its worked for me

solemn latch
modest cargo
faint bear
#

how do i solve the weird borders ?

modest cargo
# faint bear how do i solve the weird borders ?

They seem to be sampling errors from adjacent tiles on the sprite sheet
The most effective way is to add 1 pixel of padding to each sprite so the adjacent pixel is their own color, not the neighbor's

#

Generating a sprite atlas has the option to add padding automatically

faint bear
#

how do i do this ?

modest cargo
#

Which one?

faint bear
#

adding padding

modest cargo
#

If you're working in a pixelated style make sure texture filtering is set to Point and that mip maps are disabled
Also consider pixel perfect camera workflow

faint bear
#

ok thanks !

modest cargo
zenith pier
modest cargo
#

@zenith pier Those layers are used for physics and 3D culling masks
Canvas elements are sorted by order in hierarchy
Sprite renderers are sorted by these rules
https://docs.unity3d.com/Manual/2DSorting.html
Again, do not mix canvas and sprites unless you know what you're doing

analog widget
#

how do i fix this?

#

the black tiles

uncut forge
# analog widget

Pixel perfect camera. Sprite atlas. Hours opon hours to make a suboptimal system on your own. Change grid size to 99.99. etc, etc, etc.

stark ferry
#

VERY new to unity so sorry if i dont understand

fiery cedar
#

how do i make the child sprite of a gameobject (sprite) scale with it?

1st image: unscaled sprite, 2nd image: what i hope to achieve when scaling, 3rd image: what happens when i scale

willow plume
modest cargo
willow plume
willow plume
#

if that top image isnt really clear then heres the full sized version^

slim aurora
#

is there a possible way to make a animation with 2 images i have?

solemn latch
#

That's pretty vague.

abstract raptor
#

Still fairly new with the 2D tools here. My camera is set up to reflect a Gameboy resolution (160x144) using the Pixel Perfect component. I've set up a tilemap with the attached image, where tiles are 16x16. The import PPU is 100 and I've set the Grid component cell size to .16 x .16.

#

Everything SEEMS to be looking right - is it?

#

I was having problems where the tiles were much smaller than the grid size, and I've seen it suggested that this can be fixed by changing the PPU on import... but this doesn't seem to work with the Grid component.

sinful robin
#

Any way to import video with a scaling setting like Point (no filter)?

elfin sandal
#

the only thing you ever need to change is the sprites

abstract raptor
#

@elfin sandal

#

Are we talking Cell Size or overall scale?

#

If I set the Cell Size to 1, things kinda fall apart...

elfin sandal
#

change the sprite ppu to something else then

abstract raptor
#

With the Cell Size at 1, this is the PPU at 20 (I'd go to 16, but it completely swamps the screen):

#

This is the PPU at 50:

#

I can't seem to reconcile the PPU sizes with the grid spacing, @elfin sandal ...!

analog widget
#

how can i make the shadows look sharper?

abstract raptor
#

It really seems like changing the cell size is the only solution to this problem...!

elfin sandal
#

it's not the only solution but the easiest one

#

you'll have physics problems with collisions since you'll be playing at very small units but that's only if you use anything related to physics

abstract raptor
#

I mean, what's the other solution @elfin sandal ? I grant you that, say, a standard capsule collider dwarfs tiles at this scale. I'm obviously going to be using physics as I intend to run, jump, have projectiles, etc. But if I'm using the Pixel Perfect Camera component, I can't change a lot of related values on the camera...

#

I'm not opposed to doing work here, but I'm not sure I see the correct path through this.

elfin sandal
#

you changed the sprites ppu but did you also change the ppu camera component's ppu settings

abstract raptor
#

...!

#

I did not.

#

That's at 100 atm.

elfin sandal
#

might be why

abstract raptor
#

I think you're on the money. Let me mess about with that.

#

You are 100% on the money. Thank you, @elfin sandal .

elfin sandal
#

no problem UnityChanThumbsUp

modest cargo
#

As well as how many tiles/units the reference resolution corresponds to

abstract raptor
wheat summit
#

Guys i wonder if there is some tool for procedural generation for Unity of 2D top-down levels? I remember there was something like that in Heroes of Might & Magic level editor or in most recent game like Archevale.
I dont want to reinvent the wheel so can someone pointy me out if heard/know something about this?
I got tiles in tilemaps so something using this.

elfin sandal
#

Topdown engine has a procedual tool

spring crypt
#

Hey ya'll, morning. I wanted to ask what the "pixel per unit" means when importing a PNG image into unity. What is this value tied to?

solemn latch
spring crypt
solemn latch
#

Generally, for a pixel art style you will want to keep it consistent across your assets.

#

It will determine how large a pixel is in world units.

#

For instance, folks using tilemaps often base it on that(so that each tile is 1 meter for instance) or based on the size of their character for whatever physics characteristics they want.

#

Or to fit things into a particular screen size with the pixel perfect camera

spring crypt
#

Ohh I see. Thank you! Appreciate your patience ๐Ÿ™‚ ๐Ÿ‘Œ

wheat summit
spring crypt
solemn latch
#

Like for example, to emulate an SNES style look you'd use 256ร—224 reference resolution and 8 ppu

spring crypt
#

I see, so If I'm just trying to display my game for a common 1920 x 1080 resolution at a common aspect ratio of 16:9 I should just set the reference resolution to 1920 x 1080 and keep Upscale Render Texture on, so it adjusts accordingly to the player's chosen aspect ratio and resolution?

elfin sandal
#

No

#

Choose a small resolution

spring crypt
#

Why is that?

#

And do i just choose a random value?

spring crypt
#

Hey ya'll! I have this code here for my character movement (that also accounts for when the player is moving right or left and flips the asset), but whenever I press play, the character is extremely jittery (Its like the camera is shaking or something), as seen in the video. And there is also this error on the console, that I don't know what is. What could be causing this?

plush ibex
#

Hey all! I'm getting started on my first 2D game, I'm looking to use visual scripting for the bulk of the work. Is GameCreator2 a good choice for helping me develop this? The game will essentially be Texas Hold 'Em

obsidian dagger
#

Hey everyone, Hopefully an easy question.. I have multiple images that I would like to be treated as a single object in my assets folder (like a sprite sheet that has been cut). Is there a way I can manually add a group of images together like this?

small berry
solemn latch
# spring crypt Why is that?

Honestly it is probably easier to just see the effects than to explain them now that you know what's going on under the hood

somber mauve
#

When the player goes up a slope, they they float in the air. When the player goes down a slope, they don't. I'm using a composite collider for the tilemap.

uncut forge
somber mauve
#

I'm fine with the way it looks going down, but the player is higher than the slope's collider when going up the slope

uncut forge
#

or, if you want to do it in an incredibly horrible way, make the player a tilemap of its own, with each pixel a tile

uncut forge
somber mauve
#

Oh, I see

#

I'll try a circle collider then, thanks

somber mauve
solemn latch
shy shuttle
#

How would one use an ai image generator for a 2d game.
As in csn it be used to make assets (players / enemies)

grim anchor
#

guys does anybody know how to make your game NES-stile?

#

like making pixel art crisp

#

is this the right channel?

zenith pier
#

hey

#

i am trying to put a 3D cube in a 2D game. it is not showing up on the screen? how do i fix that

chrome grove
#

Is there any way at all to get rid of this warning?

zenith pier
#

hey

#

i am trying to use 3D objects in a 2D project

#

It looks like this

#

But I want it to look like this

modest cargo
chrome grove
zenith pier
#

is there a way i can increase the thickness of this 2D square

smoky socket
smoky socket
#

@zenith pier we should write here not in coding

#

also i could make you a wall if you want

zenith pier
smoky socket
zenith pier
#

wow that looks great

#

i use it as a sprite right ?

smoky socket
#

nah its 90% copy and paste

zenith pier
#

and i make this as a floor, duplicate it 4 times and make walls out of it ?

smoky socket
#

ask someone else about this i just began coding

zenith pier
#

sure np thank u!

smoky socket
#

np

modest cargo
smoky socket
#

does anyone have an idea for an simple enemy

zenith pier
#

@smoky socket

smoky socket
#

This is?

#

white is ground and pink are walls right?

#

i don't know what you want to do so i can't judge it

smoky socket
zenith pier
#

can you help me do that

#

ive been stuck on that for a long time

zenith pier
#

how do i rotate that

#

got it, but what rotation values should i put it to

lean estuary
#

If you are going to scale the asset, keep it under unscaled parent, then you can manipulate it normally.

zenith pier
#

how do i get those as walls

smoky socket
#

oh wait haven't read the middle message

smoky socket
smoky socket
zenith pier
#

it looks like this now. i just need to put top and bottom tiles

smoky socket
#

yeah

zenith pier
#

does anyone know how to create a maze node (floor and walls) using tile maps?

celest arrow
#

Are there any tools that sort of work like Unity's tilemap palette? Where you can have a set of tiles and then use them to paint/combine them into a new image?

I need to create various sprites from the base tileset so that I can then create prefabs out of them.

#

I found this, but its' not working for me https://github.com/leocub58/Tilemap-to-PNG-Unity
get error
NullReferenceException: Object reference not set to an instance of an object
TilemapToPng.Empacar () (at Assets/TilemapToPng.cs:113)
TilemapToPngEditor.OnInspectorGUI () (at Assets/TilemapToPng.cs:27)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <428cf2118a4b4a5595a2768b8e39ad35>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

GitHub

You can export your tilemaps as png in editor. Contribute to leocub58/Tilemap-to-PNG-Unity development by creating an account on GitHub.

pure flax
#

anyone know a better way to initialise my spriteshapes? (my linePrefab, is just a spriteShape made into a prefab)

       foreach (TransportLine line in transportNetwork.lines) {

           GameObject road = Instantiate(linePrefab, new Vector3(0, 0, 0), Quaternion.identity);
           SpriteShapeController shapeController = road.GetComponent<SpriteShapeController>();
           shapeController.spline.Clear();
           shapeController.spline.InsertPointAt(0, line.fromNode.worldPosition);
           shapeController.spline.InsertPointAt(1, line.toNode.worldPosition);
       }
solemn latch
chrome grove
frank vessel
valid flame
#

In a card game what's the pros of having cards as single gameobject with canvas inside on each one Vs gameobject inside a huge canvas?

thorny laurel
#

why even with point no filter does this look so bad when being sliced

zenith laurel
zenith laurel
fiery trail
#

people

#

why can't i scale up the text???

thorny laurel
#

is there a way to make those more crisp

zenith laurel
#

If the sprite sheet is larger than that max size itโ€™ll compress the image, so if size is the issue definitely try scaling that value up

zenith pier
#

why cant i see the camera ?

#

how do i fix this

#

why cant i see any grids in tile map?

young locust
#

ASK

If i want to make tilemap like harvest moon GBA, should i separate the tilemap or make it 1 complete tilemap?

viral marten
#

Hey guys, I am trying to make sprite assets, but when I put the sprite atlas texture into the TextMeshPro Asset Importer, and click create/save sprite assets, they do not show up on the list

#

The spaces where the icons would be showing are all blank, and I cannot figure out why

#

Does anyone know?

raven mesa
#

Why is Unity showing me all these extra sprites? The only sprites in my Assets folder are the colored blocks in the top-right and the ball in the top-left

abstract olive
#

Likely from some plugin you've downloaded that's using those and are in their own folders.

abstract olive
#

Unity packages will be in the packages folder.

raven mesa
abstract olive
#

They're default packages installed by Unity

raven mesa
abstract olive
#

You can add, and remove them from the package manager. You can also download and install assets via the asset store from there as well

raven mesa
abstract olive
#

You can't. You would probably have to figure out which package it was part of and remove the entire package if you weren't using it.

I don't even know if those are from a Unity package, I've never seen them.

solemn latch
modest cargo
young locust
#

ASK

If i want to make tilemap like harvest moon GBA, should i separate the tilemap or make it 1 complete tilemap?

cerulean dome
#

Is there a way to add gameobjects to a tilemap palette? Like a barrel that can be destroyed

celest tree
#

You might want to make a class something like GridObjects to add to the on-top gameobject which stores the associated tile Vector3int position; then you can easily FindObjectsOfType<GridObjects> to later find the on top gameobject associated with that tile

cerulean dome
#

@celest tree Is this the way game developers add crates, explosive barrels, chests and other interactable tiles?

gray ermine
#

Does someone know how I can keep the zoom level the same on different resolutions when using Pixel Perfect Camera? Left side is what I want the player to see, that's at 1920x1080. But when I changed this to 1366x768, then it zooms out for some reason. This absolutely cannot happen, as I only want to show the exact arena. I'd like to add black bars, but all of the "Crop Frame" options don't really fix the problem. Letterbox adds bars on top/bottom, but you can still see more of the screen on the sides. Pillarbox does the same vertically. And Windowbox makes the game a tiny box in the middle. Any ideas how to fix this?

elfin sandal
#

Make sure u check run in edit mode

gray ermine
#

There's no run in edit mode in the URP version of the component. It's always active

fiery trail
#

guys

#

why doesn't the text on my button show up?

frank vessel
still tendon
#

Anyone know how i can make it so these grass tiles have no collisions?

solemn latch
#

Official? Do you get a badge?

dreamy sail
#

hey anyone has a tip so solve this tilemap problem???

solemn latch
dreamy sail
#

yes of course! i am trying to make a smooth map for my 2D game and i would want to stop little "islands" like the ones in the screenshot to appear.

#

i have different parameters for the procedural generation (celular automata) but i can't figure out how to destroy these

stiff hamlet
#

hello i got a question how to make small pixel art better quality`

#

its 32x32

modest cargo
stiff hamlet
#

o thnx

#

HOW TO OPEN A SP`RITE SHEET?

#

like i see people have a thing with their sprites and they click it and can place them

#

WITHOUT HAING TO DUPLICATE

#

having*

lilac fjord
#

why is my character transparent a little bit, i know its not the character fault cuz it looks like my character in piskel is visible and the only thing transparent is background and also i disabled the transparency in my image and it was still transparent, i also have urp

modest cargo
# lilac fjord

Set compression to none, just below where you cropped the screenshot

still tendon
#

I'm having some trouble with my sprite rotating when it runs into small collisions (these grass tiles will not have collisions in the future), is there a way to lock the z rotation in the capsule collider component? Or does it need to be done in the script? Rigidbody?

#

Nevermind, got it to lock lol

still tendon
#

anyone have ideas on how i can remove the collisions from these grass/flower "tiles"

uncut forge
stiff hamlet
#

`how to make these in a tilemap

elfin sandal
#

If u dont know how google it

solemn latch
stiff hamlet
#

;J-;

#

;-;

solemn latch
stiff hamlet
#

how to make these into a tilemap

dusk thicket
#

is anyone familiar with the pixel perfect camera? please let me know if so

solemn latch
dusk thicket
#

Fair - I'm in the beginning stages of making a megaman based game. Looking at recent entries, I see Shovel Knight reportedly built towards a 400x240 resolution, which is pretty non-standard. Yet, it's able to scale to 16:9 seamlessly for 1080p. I'm not sure how to accomplish this with the various settings in unity - I also don't know how they did it. I can set the pixel perfect camera's target resolution to 400x240, but then I have to select the "crop to x, y" setting, which ends up letterboxing. Maybe that's fine? Either way, when I go to build settings and set the window to build to 800x480 & allow for window resizing but select 16:9 aspect ratio only, I find that I'm still able to resize the window's height and width independently and make all sorts of crazy resolutions.

I'm not sure where my approach or understanding is breaking down here, so any guidance will be appreciated. Thanks in advance!

#

Also, I couldn't get anything that seemed to make any sense at all without the "crop to x, y" setting. Without that checked to on, I would get all sorts of arbitrary sizes included in the game viewport and couldn't properly plan out tiles that would be in the viewport.

modest cargo
#

@stiff hamlet The first step is usually to read the manual and/or look at tutorials

solemn latch
latent nymph
#

anyone know why im having this weird texture overlap issue? im using an object as a brush with a texture on a tilemap, and i know the cubes arent overlapping there flush, but i still get this texture bug, anyone have any fixes?

vernal acorn
#

my freeform light doesnt make the character have shadows in different sports of the light

vernal acorn
#

its inconsistent

modest cargo
young locust
#

hi guys, how to apply exception in tile_rule when in edge canvas? should i add more until outside canvas?

#

like this?

fallow kernel
#

hello guys, I'm new here and to unity too, I wanna ask a question about pivot point, I have changed the pivot point and it keeps getting changed back, idk why the pivot point keeps following the last order of my assets here. I have spent hours and still can't fix the pivot point

modest cargo
fallow kernel
modest cargo
#

You could show the inspector for the body part gameobject and the body part texture import settings

fallow kernel
modest cargo
fallow kernel
modest cargo
#

I don't quite understand

fallow kernel
fallow kernel
#

like they are not in the middle

#

and idk why the legs suddenly fall off too, after I remove the prefab

fallow kernel
stiff hamlet
#

hello how to make custom 2d hitboxes?

#

like for a spike

modest cargo
stiff hamlet
#

spazi can u help meh with it

#

its confusing

#

like wtf am i doing

modest cargo
# stiff hamlet like wtf am i doing

you're creating many many little rectangle colliders, apparently
You'd have to make just one, click on one corner and delete, move the remaining three into a triangle shape

stiff hamlet
#

what about this?

#

if thats its hitbox

#

what about collider

modest cargo
# stiff hamlet if thats its hitbox

There's no such thing as a hitbox, to my knowledge
The physics shape you created will be used as the default Polygon Collider shape when you assign such component

stiff hamlet
#

what collider will use the physics shape?

#

of the sprite

modest cargo
#

Polygon Collider 2D

#

Moving characters don't really need an accurate physics shapes or benefit from it, and it's tedious to update the polygon collider component in case of animated characters

#

I suggest one of the primitive colliders instead

stiff hamlet
#

nah im making a game with no animations

#

im bad at animations

#

so only 1 frame

#

thanks

modest cargo
#

Still it's rarely worth the effort, and the only result is irregular and unpredictable colliders most of the time
Almost every 2D game you can find uses just rectangles, circles or capsules

#

But that's up to you

stiff hamlet
modest cargo
#

You probably don't need the collider to be pixel perfect

stiff hamlet
#

its not pixel perfect

#

im doing it near the pixels

#

im lazy

modest cargo
#

half of it seems to be

#

You surely can get away with just a triangle

stiff hamlet
#

i will try both

modest cargo
modest cargo
stiff hamlet
#

doesnt work

modest cargo
granite ginkgo
#

i deleted an old rock asset and it turned into this? anyone?

toxic sphinx
#

hey im making a characted and when i import him to unity his colors are messed up can some1 help pls

modest cargo
toxic sphinx
#

thx a lot

zenith pier
stiff hamlet
#

how to make a tilemap that uses traps?

#

like im making different traps like spikes saws

#

so different collidors

#

do i have to make multiple tilemaps?

#

or what

snow ginkgo
#

Hi! I don't know if this is the place but.. as you can see here, the bullet is going behind the wall because of Y sorting (the walls pivot is at the bottom) It should go behing it when shooting from above, but not if shooting from the bottom. I cant move the pivot because its correct like this so the characters go behind it as they are supposed to. How do you approach this?

dapper shard
#

Does anyone know what could block the 2D Shadow Caster to block the use of its edit button?

solemn latch
#

So that'll override the shape.

dapper shard
#

if only it were that simple ๐Ÿ˜ฆ

#

funny thing is, it does become available when I try to run my scene, and then it reverts back upon stopping.
So I tried copying the values while in Run mode, and it does seem to work

#

but then I get null exception galore the moment I select anything else ๐Ÿ˜

solemn latch
#

Huh, odd. I've not used that component myself to test

dapper shard
#

I'm gonna leave the lighting for what it is for now, it's not a high priority yet

summer widget
#

how can i offset my tilemap so the tiles are the correct size and line up with my chess board

abstract raptor
#

Sorry, quick dumb 2D question - can I use the Tilemap / Grid to place enemies from a palette onto the grid or am I just placing enemies, players, objects etc. in the default manner? Newish 2D user here.

final coyote
#

Hey guys I have a prob with skinning editor. I created a bone and it should be attached to the sprite that is selected like in the image but when I select the bone and the sprite and click auto geometry it doesnt move at all. The sprite doesnt react to the bone!

stable widget
#

Hi,
is it possible to make a circle sprite in a unity3D project ???
I cant find it under create > 2D , the only option is physical material 2D

vague smelt
#

Hi

#

does anyone know if there is shadow caster for tilemaps?

#

Or how to implement something like this?

still tendon
#

Hey, how would I make it so that my parallax background is behind my grid for the tilemap? I've tried putting it below the grid on the hierarchy and it didnt work.

vague smelt
still tendon
vague smelt
#

In the backround image or sprite component should be something like this

#

sorting layer and order in layer

#

just add layer called background or change number to higher

still tendon
#

that didn't change anything in relation to my grid :p

#

ah

#

I figured it out

#

thank you very much @vague smelt

vague smelt
#

np

stark badger
#

can I get gameobjects from a tilemap via cell position? I Tried GetInstantiatedObject but it returns null. Should I just implement IPointerDownHandler on the gameobjects instead of the tilemap?

stiff hamlet
#

cansomeone help me with how to use animations

#

oh wrong channel

#

sorry

modest cargo
stable mauve
#

Does anyone know how to get ruletilemaps working easily for a 2D platformer

#

idk why but i find it confusing

still tendon
#

So, I get how the rule tile works for 3x3 tilesets, but the tileset i'm using is a 6x6. Is there any way to make it so that the rule tile will autotile with a 6x6 tilemap?

rare river
#

I'm struggling to find an answer to an issue I'm having with Rule Tiles. I have a game with two tilesets: grass and spikes. I've created a rule tile for each of these separately, as well as a Palette for each.

First off, I'm not sure this is the correct approach, so please let me know if that is my issue.

But my main issue is I'm trying to get these two rule tiles to work together. i.e. a spike tile will detect a grass tile next to it and factor that into it's rules. As you can see, right now they don't work together and I'm trying to figure out how to resolve this.

stable mauve
#

L response, i tried couldnt find any good documentation

still tendon
#

yeah you're mad weird for this, bro didnt ask to ask he just asked lmao

brave adder
#

Hey I want to import this sprite

#

and this happens

ionic shore
#

my first pixel animation

#

vs my third (after watching tutorials) the tutorials i watched were rly well explained by "BAM animations" who give a very good explanation of the fundamentals of animation

brave adder
# brave adder

I think I fixed it, I dont really know how materials work

#

just shuffeled them around until it worked

ionic shore
#

nice

brave adder
#

there is still this wierd shape around it

#

and 2 dots

ionic shore
#

what software r u using?

#

cause you could've forgotten to delete the backround

brave adder
#

thats how it looks like in unity

ionic shore
#

oh

brave adder
#

and the image is png

#

deffinetly doesnt have any backgroudn

ionic shore
#

kk wait lemme check something rq

brave adder
#

at least it works :D

#

its super smol tho, can I just make it bigger in unity or will I need to do it in another program?

ionic shore
#

i just scaled my player object up and if you need to just change the hitbox

#

OH I KNOW

brave adder
#

my square guy works now!

ionic shore
#

nice

brave adder
#

hes finnaly red

brave adder
#

Okay

#

Im just

#

dumb

ionic shore
#

no dont do that

brave adder
#

why?

ionic shore
#

theres a better solution

#

cause scaling it up can cause some wierd positioning stuff that can mess up stuff

#

i forgot what its called but im opening my unity up rn to find out what its called so i can tell you how to fix it the proper way

brave adder
#

oh okay

#

thanks

#

:D

#

nice animations btw

ionic shore
#

its 1/2 loaded its pretty slow

#

ok\

#

click on the player sprite png

#

go to inspector

#

click on pixels per unit

#

and whater pixels ur character is change it to that

#

im guessing your character is 32x32

#

so just put 32 into the pixels per unity

#

then the sprite should be normal

#

there

#

if its blurry just tell me, if not then just leave it alone

brave adder
#

Ohh

#

it works :)

#

thank you

ionic shore
#

np

#

is it blurry tho?

#

cause sometimes when you do that it makes it blurry so you have to change the filter to "point (no filter)"

brave adder
#

nope

ionic shore
#

alr then your good

#

also google is ur best friend for problems

#

i learned that from a youtube video

#

and trial and error

#

and i also look at unity forums

#

those help a ton

#

i have one month experience with unity

brave adder
#

ohh nice

#

I just started today

ionic shore
#

so i have a ton of issues

brave adder
#

my goal is to make a game similiar to cuphead

#

idk how long it will take

ionic shore
#

i am actually stuck on my project rn and am waiting on a forum reply bc im having camera issues with trackign the player

ionic shore
brave adder
#

do you know why it has these wierd borders?

ionic shore
#

i actually dont

#

maybe ur software?

#

what were u using?

brave adder
#

I just installed these from the unity assets thing

ionic shore
#

oh

#

ok

#

then its unity

brave adder
#

the image doesnt have it

#

it only shows on unity

ionic shore
#

send a screenshot of your inspector for the png

brave adder
ionic shore
#

ok ill compare to mine

brave adder
#

its not really that important, I can use my square guy

#

now that I know how to scale him up

#

or down

ionic shore
#

naw graphics are important in a game

#

did you just drag and drop the png into the game scene?

#

cause i cant find a difference

brave adder
#

my game is basicly 3 platforms and a script that allows player movement that I stole from a yt vid lol

ionic shore
#

oh bendux?

#

yeah i did that too

modest cargo
brave adder
ionic shore
#

oh ok then thats not it

ionic shore
brave adder
#

oh yeah

#

its fixed

#

thanks @modest cargo

brave adder
modest cargo
brave adder
#

he replied to my problem in like 12 mins

ionic shore
brave adder
#

Also it seems that flipping doesnt work for me

#

from the yt video

#

but thats probably a code problem

#

yep, it was a code problem

#

a very simple to fix code problem

#

anyways thanks a lot for the help

#

35min past!!

#

time flies by so quick

#

wtf

ionic shore
#

lol ikr

#

i didnt notice either

reef violet
#

so in pixels

#

that you can color a pixel in by clicking on it

modest cargo
tame hinge
#

is there a way to know exactly on which pixel a sprite/object was hit?

#

or at least the general location where on the object so I can approximate the coordinates of the pixel

#

I know there is a way to know in terms of worldspace

#

for context I am trying to recreate the disintegrating barrier mechanic from the original space invaders but I have no clue how to solve it

modest cargo
tame hinge
#

@modest cargo I was gonna do individual objects but having to line up smalls sections of a sprite would be such a pain

#

if I don't want to just have normal squares but simulate some progressive breakdown

#

but destructible tilemap? ๐Ÿ‘€

#

that sounds pretty interesting

modest cargo
tame hinge
#

I assume it would work if all my sprites have the same dimensions but my other approach didn't have that

#

so you'd do destructible tilemaps @modest cargo ?

modest cargo
tame hinge
#

thx

#

unfortunately it won't be like how it works in the original game but I am not competent enough to write my own pixel based collision system yet

modest cargo
tame hinge
#

I mean the way I am doing it now is it would just remove a 4x4 chunk of the sprite overall and it wouldn't look like dynamic destruction like in the original

#

but I don't really care anymore

#

as opposed to smth like this

modest cargo
#

Why not treat individual pixels as tiles?
I'm not sure how the tilemap handles tiny and dense grids like that, but it's surely worth a try

tame hinge
#

not sure if I would run into similar problems I had when I tried to manipulate the sprite pixels directly

#

but it might be worth a try, even if it sounds like a lot of work :P

#

I would have to destroy tiles based on direction of impact and also destroy tiles around it in a "realistic" enough fashion

modest cargo
modest cargo
tame hinge
#

Well, I have to research destructible tilemaps in general first anyway

#

I know how normal ones work to a degree

#

Actually I know nothing of tilemaps

#

@modest cargo since tilesize depends on unity units as everything, how would I even tell it to be a 1px x 1px tilemap o.o

modest cargo
#

Which is the PPU value of your sprites

#

If you want to skip all the math, treat one unit as one pixel and set the sprite PPUs to 1
But I recommend that only if your play area isn't much larger than one screen

tame hinge
#

wait I might be dumb

#

my ppu is 16

modest cargo
# tame hinge my ppu is 16

The PPU can be anything, but it's most useful to guarantee that tile sprite graphics have a specific resolution
But since you use pixels, sprite resolution is not a meaningful concept

tame hinge
#

Imma play around with it

#

I have to figure out tilemaps first :P

tame hinge
#

drawing tiles that small didn't seem to be a problem but I wonder how collisions will work

tame hinge
#

although for some reason with the tilemapcollider attached the collisions don't seem to work

#

did I forget something

#

OnCollisionEnter2D doesn't fire

#

ah, it's possible that the collider type isn't working

modest cargo
tame hinge
#

on the tile asset itself you can set collider type from none to sprite or grid

#

grid works though, at least it generated a collider

#

now somehow have to figure out how to destroy single tiles

#

tile destruction works but it's VERY inaccurate so far

#

sometimes tiles get destroyed and some don't, hmm

#

but it almost works

modest cargo
tame hinge
#
    private void OnCollisionEnter2D(Collision2D collision)
    {
        int contactAmount = collision.contactCount;
        for (int i = 0; i < contactAmount; i++)
        {
            ContactPoint2D contact = collision.GetContact(i);
            DestroyCells(contact);
        }
    
    }

    private void DestroyCells(ContactPoint2D contact)
    {
        Vector3Int pos = _tilemap.WorldToCell(contact.point);
        _tilemap.SetTile(pos, null);
    }
#

that's more or less the only thing that makes sense

#

things that affect which tiles get destroyed are the speed of my bullets and the max tile change count on the collider

#

the odd thing is, it's always the same tiles that don't get destroyed

#

I'll try if continuous collision detection changes anything

#

the ones on the left don't get destroyed for example

#

is there no way to move my game view if I zoom in btw

#

As I suspected though, the collider is not working properly

#

I have a feeling it might be too small/dense?

modest cargo
#

Or the scroll bars
Assuming you mean the zoom function of Game window

modest cargo
tame hinge
#

I think so

#

one pixel per tile

#

one pixel is 16ppu

modest cargo
#

So a 16x16 sprite?

tame hinge
#

but I might try a gameobject centric approach instead

#

it's a 1x1 sprite lol

modest cargo
#

If one "pixel" is 16 pixels per unit, that implies your tilemap is 16 tiles per unit, assuming one pixel sprite per tile

#

which sounds dense to me

tame hinge
#

it's pretty dense yeah

tame hinge
modest cargo
tame hinge
#

The game object based approach worked

modest cargo
#

Also, worth noting that what your projectiles are and how you're moving them has a significant effect on their collision accuracy

tame hinge
#

I move them like so

_rb.velocity = shotDirection * _shotSpeed.Value;
#

shotDirection can be Vector2.up/down/left/right

modest cargo
#

That's good, means you can use continuous collision detection
Moving objects by other means than forces or velocity has a negative effect, and all moving colliders should ideally have a rigidbody

tame hinge
#

good to know I did it right yes

vague smelt
#

Hey, I have 2 questions how to fix some things, first thing is that when I have 2 tilemaps and floor map uses normal map texture, which is sometimes visible through second tilemap created for walls. Second thing is how to make player above this shadow so it will not be clipping player

devout moth
#

i want to do uv-mapping with uv editor like 6 sided cube but there is nothing i can choose. what is the problem her?

white talon
#

noob alert
I've looked everyone for an answer, but I think I'm using poor wording.
I have these huge spite sheets to decorate my interior with, and I was planning to just chop it up and drag what I want into the scene, but Unity breaks them up in such an unorganized mess.

#

is there a window, an organizer? Something to help with this?

#

or is there a way to make the images larger in the project viewer

viral tusk
#

Hello,

#

I'm trying to make a checkered rule tile, so when I draw, it automatically makes like checkerboard effect.

#

This is what I've setup, but it's only green.

#

I was hoping someone could point me in the right direction?

astral anchor
#

Is there any way to add these "exceptions" with rule tiles?
I want to add a different slope tile that doesn't get auto-placed but it still affects other tiles in the rule tile.
right now, I made a different tileset with the sloped pieces, but its not affecting the rule tile set.
Anyone know what I should do?

crisp edge
#

I'm running into an issue I was hoping I could get some guidance on my tilemap. I have the tilemap collider 2D attached to my tiles, my character does not fall through the ground, but he is able to pass through the sides of tiles and I'm not sure exactly why. If it's a slope, he'll go up the slope but if it's a sharp increase I intended to be jumped over, he can just walk right through them.I may be using the wrong terms when searching but I can't seem to figure out any answer to what's causing this and what I can do to fix it.

crisp edge
#

I figured out what the cause was - I have freeze position x checked in my constraints. I'm not sure why that causes me to be able to pass through walls though.

modest cargo
#

If you can move at all, that suggests you're using some type of incremental teleportation to move (such as .position, .Translate() or .MovePosition()) which ignores rigidbody physics

crisp edge
#

Yeah I was using .Translate(), I switched it to .velocity after doing some more research. Finding out the X position was frozen was the cause helped me look into it a little more

crisp edge
#

It's my second project not following a tutorial so I've got a bit to learn ๐Ÿ™ƒ

modest cargo
#

They are not "training wheels"

crisp edge
#

Oh no I meant not a guided "This is what we're gonna make, and now make a script and put this code in it" tutorial.

vestal tusk
#

Unity lost pixels/lowered the alpha of my sprites. Is there a fix for that?
The first image is from the Unity Sprite Editor and the second one is from the software I use to draw stuff.

zenith laurel
vestal tusk
modest cargo
vestal tusk
zenith laurel
#

The option should be right under the filter setting

vestal tusk
#

Ho it's that thing. I though it was just working in game, not in the Sprite Editor.

#

Thank you very much

small moon
#

is it possible to regenerate the polygon collider so, when a sprite mask is added, it will redraw the collider to match?

#

or just some way to make other objects ignore the bits being covered by a sprite mask

small moon
#

OP says they solved it by "using layer masks" without elaborating, but I'm not sure exactly what they were doing with said layer masks

#

their results seem pretty great so I'm curious if anyone has an idea how they did this with layer masks?

#

they did mention the Clipper library but unless I'm illiterate, they don't say they actually used it to get this result

modest cargo
# vague smelt Can anyone help?

Although I don't recommend upgrading beyond LTS versions, I heard that overall glitchyness of 2D lights seem to have been reduced in 2022.2.

vague smelt
#

I'm in 2021.3.19f1

#

hm

modest cargo
#

Including the glitch of it randomly ignoring shadow casters or disappearing

vague smelt
#

normal maps are on side textures too

#

what is happening

modest cargo
#

It may be worth the try to upgrade a copy of the project

modest cargo
vague smelt
modest cargo
vague smelt
#

Idk but I think I know what is propably causing this

#

because I have custom shader for vision (Game only renders where I look), maybe it does something wrong in this custom code

#

because it looks like on default lit 2d material it doesn't happens

modest cargo
#

Always helpful to start with those kind of details
We have no way of knowing what custom assets you have that could be causing issues

vague smelt
#

I can send the code of it

#

btw it is not mine but from someone's vid I think

#

It has 2 materials vision entity and vision background

#

And it just changes the last blending style to it

modest cargo
#

Is it intended to be used with Unity's 2D lighting? Or is the lighting custom too?

vague smelt
#

unity's

#

it is copied lit 2d shader and added extra things to it

#

Okay nevermind somehow fixed it by adding normal map to wall texture

spring wharf
#

Does anyone know what I am doing wrong?

#

Hey, as soon as I enter animation mode, changing the position/rotation of my sprites doesn't work anymore, see the gif:

spring wharf
#

Here you see that afterwards in fact the transform is successfully animated, just the sprite is not updated

short osprey
#

Hey people! I am having a silly issue. I am working with URP 2D and set up many polygon colliders configured as triggers on my scene. I found out that the reference sprites were off position by some little amount, so I moved them back where they are supposed to be, but now of course all the triggers, owned by an other game object, are off position by that same amount. I saw that i can offset them, but I would like to move them all in the right position while keeping the offset at zero. Is there a way to achieve that?

#

I mean, other than rebuilding all of them from scratch or moving them point by point to the new position...?

modest cargo
short osprey
#

A little uncomfortable, but it will be useful in the future I guess

#

Thanks

modest cargo
short osprey
#

They are triggers manually placed on the scene, not physics colliders, unfortunately

modest cargo
#

Triggers and colliders are created the same way

#

But if they're not based on sprites I think it's not an option anyhow

short osprey
#

yes, but they are not shaped around sprites, they are manually shaped

short osprey
#

it's a bit hard to describe the scene structure, but the key is that these triggers are not shaped around sprites

#

Thanks indeed, the idea itself was good if that was the case

modest cargo
analog widget
#

is it possible to generate shadows from a tilemap collider?

#

2d shadows are kinda really annoying lmao

normal river
#

How do I trim sprites without changing the center pivot assigned from a grid slice?

modest cargo
#

Or hot swap the sprite sheet with cropped versions if all else fails

normal river
#

i exported so that my rotating sprite stays around a 64x64 grid, trimming makes the pivot of the sprite the center of the sprite area and not it's original grid slices

modest cargo
#

Well, I think the more meaningful response may be why do you need to crop it in the first place exactly

normal river
#

i was under the impression the sprite bounds determined the hitbox

modest cargo
#

"hitbox"?

normal river
#

for collisions

modest cargo
#

"Physics shape" in the sprite editor defines the default shape of a polygon collider component assigned to the same gameobject

#

If your sprite shape is "tight" it should be perfectly cropped to begin with

normal river
#

oooh

#

very helpful thank you!

#

just saved me a ton of time lol

modest cargo
#

Other than that you'll be using primitive collider components which I think also take their initial size from the physics shape, but you'll often customize those anyhow

#

Or create generic variants

#

@normal river One more thing to note is that no type of collider adjusts to animation automatically
The shape is only considered at the time of adding the component

normal river
#

so i got to change the outline tolerance to 1 for each of these and generate each manually?

#

or will this work:

modest cargo
normal river
#

ah ok

modest cargo
#

But again since the polygon collider doesn't respond to changes like animation, I expect you may want to use a generic primitive collider instead

#

At least what I would do is build colliders from boxes and circles in the shape that matches well enough all animations, and when they don't, keyframe the colliders to match

#

Polygon colliders can also be keyframed iirc but it's kinda tedious and pointless

#

Players often prefer predictable colliders over precise ones

normal river
#

why is this happening during my empty frames?

solemn latch
normal river
modest cargo
#

Rather than displaying "empty frames"

true niche
#

Guys i'm using multiple tilesets to make a layered map, do you know why when i zoom in and out some layers disappear and reappear?

modest cargo
true niche
#

then the order is by the actual order of the objects in the hierarchy

modest cargo
still tendon
#

I sent this a few days ago and I'm sorry to repost it but it's probably something stupid that would be more equate here

modest cargo
#

It's also possible that there's problems with the import settings, but it's hard to give a precise diagnosis on an example that's had its context cropped out

still tendon
#

It's a 16x16 tilemap

#

I just stared building the world and in the game tab it like not rendering as if it was low res pixel based

#

I can send a more detailed screenshot after school

elfin sandal
#

did u use pixel perfect component

still tendon
#

The what?

#

I assume that will help me

modest cargo
still tendon
#

i jsut got home so now im loading up unity

#

ill send a screenshot of my project in a min

#

here it is

#

here is the camera setings if that helps

#

okay so it was jsut the fact the camera was way to big compared to the sence lol

#

i made it big being that i was gunna make a huge world map

modest cargo
#

Resolution, camera ortho size (and game window zoom) are very important for how pixel art is displayed

still tendon
#

i guess i jsut expand it as the project gets bigger?

modest cargo
#

Ultimately you cannot display more than one sprite pixel in one screen pixel, or distortion will ensue

still tendon
#

im sorry but i have no clue what you mean

modest cargo
#

If your monitor is 2 pixels by 2 pixels, how are you going to display a sprite that's 3 pixels by 3 pixels without loss of data

still tendon
#

oh wait do you mean its try to expand it but because its one pixel thats not posible to - yeah i jsut realized it sometimes im a bit slow

modest cargo
#

It's a very common mistake ^^

#

To render pixel art perfectly, you'd have to make sure that each sprite pixel matches each screen pixel precisely, in position, rotation and size

#

Basically it means that sprite size / pixels per unit value, ortho camera size and screen resolution must all have a very specific ratio

still tendon
#

so jsut expand cam as i grow the world tilemap

modest cargo
#

No
The camera size must match the resolution of your sprites, regardless of the size of your level

#

You can expand it to zoom out, but then the pixels get mushed together again

still tendon
#

but then jsut move the camera to show difrent parts?

modest cargo
#

Realistically you have two options
Learn to use the pixel perfect component
or give up anything being pixel perfect and just eyeball it so that it's good enough

#

It's not enough to get the PPU values, ortho size and display resolution to the correct ratio, you'll also have to restrict sprite positions to pixel increments
The pixel perfect camera component does all that and more

still tendon
modest cargo
# still tendon id like to eliminate any blur and warping so i guess lean the pixel perfect thin...

https://blog.unity.com/technology/2d-pixel-perfect-how-to-set-up-your-unity-project-for-retro-8-bits-games
Here's an article that explains what it does and how and other tidbits about retro graphics rendering, pretty important reading in my opinion
https://docs.unity3d.com/Packages/com.unity.2d.pixel-perfect@5.0/manual/index.html
Here's the manual that explains how to set up the component in full detail

solemn latch
modest cargo
solemn latch
#

The problem is that Unity wasn't designed with pixel art in mind =p

#

Which is pretty reasonable since back then there were better options for that kinda thing.

sharp apex
#

I hope Unity upgrades its Tilemap package so we have a better implementation of Tile Rules, like the one from Tiled/ASEsprite featured in this video:
https://www.youtube.com/watch?v=TL_JZIuydas

Hey Pals! I got permission to share this sneak peek of an upcoming Aseprite update with a brand new Tilemap feature. Mate, I've been waiting for this feature since 2019. It's too good. You're going to love it. Make sure you check for news on the open beta at:

https://www.aseprite.org/
https://twitter.com/aseprite?lang=en

P.S. First 1080p uplo...

โ–ถ Play video
languid tendon
#

quick question why is it I can't activate the snap tool when working in 2d unity and how do I fix it

solemn latch
modest cargo
#

You can read Tiled tilemaps in Unity, but it won't respond to runtime changes naturally

modest cargo
#

Vertex snapping doesn't care

river iron
#

https://cdn.discordapp.com/attachments/763502300781477948/1082446168598007878/Growth_-_Main_-_Windows_Mac_Linux_-_Unity_2021.3.20f1_Personal__DX11__2023-03-06_23-30-44_Trim.mp4

I'm having an issue with a cursor not following my mouse fully correctly and jittering loads

The camera sets its position to the physical player rigidbody position

The cursor sets its position to the Input.mousePostion

This happens nomatter what update / fixed update / late update I put either of these in

I'm unsure if this is the correct place but I believe it's to do with the pixel perfect camera im using

worn zealot
#

That spider is adorable. And yeah, it is probably due to pixel perfect camera if changing when in the order you are executing.

river iron
#

Lil bro says hi

#

But yeah if it is a pixel perfect camera issue I don't know if it's one I can solve

modest cargo
#

It seems to lag behind as it is

river iron
#

Sprite renderer on a gameobject i set the position of

modest cargo
#

"set" how
to what

river iron
#

So literally just transform.position = mouse position

#

Using Camera.main.ScreenToWorld

#

Sorry not at pc rn otherwise I'd ss the code

#

but yeah I've stripped it back to just bare minimum of setting position of the cursor to the mouse

#

No lerping

#

the cursor is a parent object with 4 children corner objects if that matters

#

But the children do not move

modest cargo
#

Hmm, parenting is the most robust way to attach things together
I would try as a test to disable the cursor script and just parent the cursor to the camera, see if it still seems to jitter

#

If it still does, the script isn't at fault

#

If it doesn't, I'd try to enable the cursor script and make sure the moving happens in LateUpdate

river iron
#

Right so parent it first to see

#

Then I can still set position

#

it shouldn't affect the script itself actually just parenting so no reason not to yeah good plan

#

We'll see but I'm not hopeful will check in a bit

river iron
#

its almost as if Camera.main.ScreenToWorldPoint(Input.mousePosition) isnt being updated properly even tho its in LateUpdate

elfin sandal
#

Probably floating point errors

#

Youd need to tell your script to move in pixel increments

#

Or just have the cursor be part of the ui canvas instead of a world object

rain hornet
#

is there a better way to import tiles into a rule tile? i am using 2d extras in unity to create rule tiles, however manually selecting tiles from the expanded .png is very annoying and also very hard to see since my sprites are 16x16

modest cargo
#

for whatever reason

ruby hamlet
#

Hi can someone help me
this video I was following on youtube said to add a sorting layer and call it Background and move it above the default layer and move all my background sprites there
but this happens when I do that

#

but if I move my sorting layers back to default it all shows up

modest cargo
rain hornet
# modest cargo I find that you can add multiple sprites at once, but only if the rule tile list...

yes, right now I use shift and ctrl click to select multiple tiles that I will have to add

While This Helps a lot I don't know why I cant add multiple sprites like this when the list has something.

this is especially annoying since in a [serialized] list field I can add multiple items at once but not in this one

also is there a way to view the expanded .png or attest the sliced sprites in an organized manner like how importing the sprits to a tile map pallet allows you to.

modest cargo
plain girder
river iron
cerulean parcel
#

i'm using a pixel perfect camera and I have no Idea what to put here, what are these numbers supposed to be? what numbers do I want?

abstract olive
shadow cargo
#

Sprite not showing correctly? (New to Unity)

zenith pier
#

what does this error mean

jolly narwhal
#

It means that you have an inactive object that tries to start a coroutine

zenith pier
jolly narwhal
#

Don't start a coroutine in an inactive object

zenith pier
jolly narwhal
#

SetActive(true)

novel timber
#

What happened to my sprites after i imported them to unity?
1st pic is before and second is after

#

If anyone responds, please ping me

novel timber
#

oh right

#

thank you very much

zenith pier
#

hey guys ive used the A* pathfinding package and the AI for the enemy to follow the player (pink) but as you can see the path for the enemy is through the walls, how do i make it such that the enemy can avoid the walls? because the enemy gets stuck at random places and cannot follow the player. thanks!

modest cargo
modest cargo
#

And as always start from the documentation, if you haven't already

faint dune
#

I am trying to set a normal map for the SpriteShapeRenderer fill material inspired by https://forum.unity.com/threads/spriteshape-2d-lighting-fill-does-not-support-normal-map.1257141/. After saving it somehow looks like attached picture. Anyone solved this issue before? (Using 2022.2.9)

    private void OnValidate()
    {
        var renderer = GetComponent<SpriteShapeRenderer>();
        if (renderer.sharedMaterial.GetTexture("_NormalMap") != _normal)
        {
            renderer.sharedMaterial.SetTexture("_NormalMap", _normal);
        }
    }```
#

Looked like this before btw

novel timber
#

Is there anyone who is using 2D Aseprite Importer? I need help ;c

blissful yoke
#

Hello, i need help with rule tiles (package: 2D tilemap extras), i am currently trying to get my own rules into it, i used https://github.com/Unity-Technologies/2d-techdemos/blob/master/Assets/Tilemap/Rule Tiles/Rule Override Tile/ExampleSiblingRuleTile.cs and i would like to know the tile position, so i can prevent lag as i am working with big tilemaps, by knowing position i can disable all of rule tile functions when the tile is far enough from camera, i know exactly how to do it, but i cant change the rule tile script (this is what it says: The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered: Packages/com.unity.2d.tilemap.extras/Runtime/Tiles/RuleTile/RuleTile.cs), is there any way to edit this script?

GitHub

Tech Demos for Unity 2D Features. Contribute to Unity-Technologies/2d-techdemos development by creating an account on GitHub.

solemn latch
zenith pier
#

hey guys! i have a serialized field text mesh pro for my scores in my gameplay scene but i want to display the score in my other scene which is the menu screen. how do i drag and drop the text from the landing screen to my serialised field in the gameplay scene?

#

scoreLandingScreen is in my 'Landing Screen' scene and i want to drop and drop it to the player game object in the gameplay scene.

rugged parcel
#

hello, how can I change the render order of my tile maps?

#

Every time I finish editing my tiles the way I want them, which is to have the wall tiles over the floor tiles, they reverse and the floor tiles render over the wall tiles

modest cargo
upbeat edge
#

Id like to add empty spots in this ruletile to cover my levels randomly with grass in one fell swoop with the bucket / area paint tool. What's the best way to add blanks spaces here? Just blank game objects, or should I make a transparent tile?

#

I did initially try adding empty spots in the Size property, but it seemed to really skew the randomness.

#

Yeah actually, I think i needed to just add a whole bunch of empty ones to the middle, instead of the sides. And an equal amount on either side at that.

upbeat berry
#

I assume these are common questions; so I'm hoping there are common answers. I'm working with an isometric tilemap and am having sprite layering issues. Specifically, I'm struggling with where to put the pivot point on wall sprites.

  1. This first issue I'm having is that the pivot is used to position the sprite on the tile relative to the tile anchor. This means the pivot has two responsibilities; one to order and one to place, and they are often in conflict.

  2. The second issue I'm having is where to place the pivot for objects that are rectangular as seen in the image. If I place the pivot on the lowest traversable point behind the wall, then sprite layering works when the character is behind. But if the sprite is at the highest traversable position or just simply above the pivot point, but in front of the wall.. The character will appear erroneously behind the wall.

It seems like this just may be a limitation of the engine and I need to adjust my asset creation process to ensure that walls aren't long enough to have the desired pivot be behind and in front of the wall. I just wanted to make sure there isn't a tool or feature I'm overlooking that solves this problem.

It appears the solution to both issues would be to ensure that walls take up the entirety of the tile...

Any thoughts would be appreciated. Thanks!

hard nimbus
#

I keep getting these weird lines between my tiles

modest cargo
# hard nimbus I keep getting these weird lines between my tiles

If you're not using pixel perfect rendering, tilemaps may show adjacent pixels from the tiles' sprite sheet
If you don't need pixel perfectness and only need to fix that, you can add padding to your sprite sheets between each sprite in an external image editor, or generate a sprite atlas which also has the option to add padding

hard nimbus
#

how do I use the sprite atlas in a tilemap?

#

or rather, I already tried pixel perfect camera but it didn't seem to work well (camera randomly jumps between different zooom factors, laggy cam movement. I am using cinemachine but I did also add the pixel perfect cinemachine effect which didn't do much

modest cargo
hard nimbus
#

alright, pixel perfect does seem to work now

#

for some reason

#

but it makes my camera zoom in more

modest cargo
hard nimbus
#

I mean I want to make a game with mainly pixel art style

#

but I don't want the movement or camera move pixelated

#

so for the sprite atlas (sry for switching all the time but I think that'd be the best solution)

#

I packed every spritesheet into it

#

and then? is it automatically used for all the tiles? bc it doesn't seem to do anything

modest cargo
hard nimbus
#

ah setting padding to 8 seemed to fix it

modest cargo
#

If you can find this menu "always enabled" would at least make sure it runs

hard nimbus
#

but now I'm getting this error

#

everytime I playtest

modest cargo
#

Vague editor errors may be annoying but are rarely concerning unless they visibly break something

hard nimbus
#

yeah truer

#

but it only happens since I changed the padding

#

weird

modest cargo
#

It's as cryptic as it is generic
With luck it'll stop occuring on its own, maybe on scene change or editor restart or something

hard nimbus
#

alright thanks for the help!

arctic harness
#

hi im new to unity, can anyone suggest a method to learn unity 2d without following tutorials blindly(i have some coding experience in python and I know the basic fundamentals of programing)

lost flint
arctic harness
lost flint
#

Because it contains everything you need to start up and has been validated by people with experience.

arctic harness
#

no, i meant which course

lost flint
#

My bad, I read your message a bit too fast.

arctic harness
#

nah its ok

stray whale
#

When working with tilemap tiles, movement causes these weird lines to appear, both in the editor and in the finished exported product. Does anyone know what's causing this?

using 2d tilemap extras

stray whale
#

Fixed!

tropic jungle
#

Anyone know a good place to get grass/dirt/sand/etc. textures that span large areas? I'm looking for seamless textures that are 1024x1024 - 4096x4096 but represent 50-100 square meters of terrain so that the repetitive nature of textures is not noticeable. I'm willing to purchase the textures, but free ones that I can use for prototyping would be fine also. Everything I'm finding is mostly designed to be repeated every 1-3 square meters and that just doesn't look right.

modest cargo
# tropic jungle Anyone know a good place to get grass/dirt/sand/etc. textures that span large ar...

It's not usually the first option to try eliminate repetition with just one perfect texture
Usually you see the patterns broken up by blending between multiple textures and terrain types as well as with detail meshes, that's how you see it done in 90% of games
In case of monotonous terrain material it's common to combine a low-resolution texture with "detail mapping", so the low res texture gives color variance to the detail map which is only seen so close you won't see the repeat
Even beyond that there are shaders that can break up the repetition, though those are more expensive to render
https://github.com/UnityLabs/procedural-stochastic-texturing

#

In 2D the concepts remain the same but implementation may be different

tropic jungle
# modest cargo It's not usually the first option to try eliminate repetition with just one perf...

Thanks ... While I'm sure I'm going against the grain (which is not a good thing), I wrote a custom shader with DOTS Instancing that uses a 2D Texture Array of biome textures and blends between them based on the biome of each "tile". I hope I didn't shoot myself in the foot too much. I like how games like RimWorld handled terrain that looks natural over larger areas (see screenshot). I'm able to achieve that ... but I don't have textures I like.

#

What mine looks like so far (the scale is very wrong right now, those dots are trees when you zoom in while the grass texture is spread too wide for what the texture is):

modest cargo
#

Thanks While I m sure I m going against

dim wraith
#

Is it fairly normal for a scene to have multiple tilemaps on different layers to show depth, or is there another way to do this?

solemn latch
tropic jungle
#

I might explore other options with my shader later, I found a texture I'm a bit more happy with for now. I want something more realistic in the future, but this is at least moving in the direction I want:

hidden swan
#

tileset building is pain

opaque snow
#

I want to make my sprite twice as wide, is there anyway I can do that in the Unity sprite editor?

#

My sprite editor has some options greyed out as well and I don't know why. Would this help?

elfin sandal
#

Either change the scale intransform settings or the pixels per unit when selecting the sprite file

modest cargo
modest cargo
#

I believe the position in the sprite editor signifies where individual slices are in the sheet, but only multiple type sprites have more than one slice

agile obsidian
#

why does my tile rule look weird am i doing something wrong

#

this is the way i actually want it to look like

tropic jungle
opaque snow
#

This is a png I want to import as an asset into Unity.

#

When I try, the sprite imports like this:

#

This pink doesn't appear in the sprite editor and I have no idea how to remove it. Any ideas?

modest cargo
opaque snow
#

My material is default-line

#

Also, other sprites are unaffected:

#

I haven't tested out all of my sprites as I don't want to have to format all of them, then remake them, then reformat

modest cargo
# opaque snow What else could it be?

Not sure but your sprite renderers aren't using the sprite material, like I expected
Isn't the obvious first solution to try to swap to a sprite material

opaque snow
#

Thank you for the help. I though Default-Line was the material in question by I found a new one