#🖼️┃2d-tools

1 messages · Page 4 of 1

red gulch
#

is there any way to have a sprite masked by multiple other sprites?

upbeat edge
#

yes the tilemap is useful for 2d pathfinding as well as world generation. you can get the locations of each cell in the tilemap and instantiate or activate objects / tiles depending on your needs, as well as having enemies locate objects on the tilemap and move from tile to tile toward them

civic cypress
#

Hey I am totally new and I am making this little game based of a tutorial. The tilemap never had any blue lines but all of a sudden (even though I have not changed anything) there is one between 2 chunks (I think thats what it's called)

still tendon
civic cypress
#

yes

civic cypress
still tendon
# civic cypress yes

How to fix tilemap tearing and edges/gaps in a 2D Unity Project is much simpler than you think and does not require reimporting or manipulation of any of your 2D assets, a simple Sprite Atlas is all you need and I'll show you how to do that in under 3 minutes. Tilemaps in a 2D Unity project can be quite frustrating but fixing them is easy. Plea...

▶ Play video
civic cypress
#

Thank you 🙂

still tendon
#

yeye ofc

#

If that guys solution doesnt work, I swear the easiest fix was to change the grid to something 0.001. I'd have to check my old 2d project to see lol

civic cypress
still tendon
severe comet
#

how can I make a tilemap collider trigger for every tile, for some reason it is only triggering enter when I leave a whole bunch of tiles rather than each one

#

and I don't have a composite collider either

raw falcon
#

native Pixel perfect camera (2D URP) wont work with camera stacking (what I use for parallax, especially parallax zoom) , anyone have an alternative method for PixelPerfect + upscale render texture, that would work with stacking? https://forum.unity.com/threads/pixel-perfect-or-upscaled-render-texture-with-2d-camera-stacking.948634/

modest cargo
raw falcon
# modest cargo I suppose you could use a custom post processing effect that upscales the render...

yeah I'd always done parallax that way for panning, but if you're trying to emulate zoom I find that http://www.procamera2d.com/ had a good solution in that you scale the orthosize of the cameras, and you use one camera per layer

The definitive 2D and 2.5D Unity camera solution! Includes extensions for Pixel-Perfect, Shake, Cinematics, Transitions, Rooms, Pan and Zoom, Boundaries, and much more!

#

rather than trying to "zoom" the world by scaling / translating

#

I'm looking into rendering to an RT at the res I want (640x360)

#

and rendering that on a canvas? I dunno i haven't done a lot of post/SRP style work

raw falcon
#

ok this is promising. giving me the results I'm expecting anyways

#

weird to have that "No camera's rendering", but I guess since I'm pretty much kicking everything onto a UI texture now

raw falcon
#

sweet, got CRT filter working too

raw falcon
#

whew, that was gonna put a damper on the day , hopefully not much of a performance hit to render one 640x360 RT on a canvas

molten grotto
#

can someone tell my why my character looks so bad

#

colors are mixed

#

and very low quality

#

looks fine in asesprite

#

its 16x32

elfin sandal
#

change sprite's compression to none and filter to point

molten grotto
#

yayy

#

thanks

#

ur best

#

it fixed

elfin sandal
#

np, it's a common issue that we should have in the pinned section but we don't

#

:/

modest cargo
raw falcon
modest cargo
raw falcon
#

Yeah IIRC I remember reading to build performant UIs use many canvases so that when one updates it doesn’t redraw the whole screen when you update one widget

#

Ok I’ll try to put the output RT on a world layer sprite or an unlit quad

#

My post effects should work either way

#

Gonna do that next year tho - happy new year @modest cargo !

solemn latch
severe comet
frail glen
#

So I'm trying to generate a 2d shader based on this tutorial:

https://m.youtube.com/watch?v=ACyqpLh4jrs

But even after installing URP, I'm lacking the last 4 options.

(1st picture is the tutorial image, 2nd picture is mine)

noble cape
#

I'm new to gamedev in general, I wanted an opinion, is this too big for a character?

#

it's for a project planning to star

modest cargo
frail glen
noble cape
modest cargo
noble cape
#

thanks, as I said I'm a noob at gamedev I will make some prototypes ^^

molten grotto
#

when i imported animation for my 2d character it disappeared

#

how can i fix this

#

i noticed that animation is happening in background layer

#

how do i fix this

#

nwm i somehow fixed it

ornate spade
#

why is it that i can't slice in the sprite editor?

modest cargo
ornate spade
#

yeah i figured that out after one google search, which is probably the place i should have started with but still thanks

leaden sonnet
#

Does anyone that has a good idea of Rule Tiles think they could help me out? I want to get these tiles to create a wall like this, but i'm having trouble getting the rules for it right

leaden sonnet
#

Heres some examples of what they should look like

cerulean vault
cerulean vault
noble cape
leaden sonnet
noble cape
#

thank u guys ^^

leaden sonnet
#

Anyone got an idea why this is happening? I'm getting close to the result I want

leaden sonnet
half cliff
#

Hello i wanna make some pixel game art and idk if there is any pixelart people in here but if you could help me with figuring out the size of the player sprite in this picture.

I wanna make pixelart myself and I found that pixelarchitect on Youtubes art looks very detailed and good so I wanna draw mine at the same size.

It is the player sprite I'm asking the size of

Down at the bortom it says that the entire picture is draw in 640x 360 pixels if that help but I do not know if the picture is zoomed in or not so.

I tried with my eye to count the player pixels from to pto bortom i got somewhere between 49-51 and that seems off? Usually sprites are in 8,16,32,64 right? So could this be a custom size? Plz help if you can

charred rain
solemn latch
shadow cargo
#

Forgive me if this is the wrong channel, I'm new to Unity.

I have a camera outputing to a "Render Texture". But when I try to apply that texture to something, it doesn't show up in search?

shadow cargo
forest dagger
#

Why does the sprites overlap? I used 2d sprites in designing and now when a panel appears even if it's above it, the sprites is still shown on top. How can I make it not overlap?

willow reef
#

Anybody know how to set the background image for a 2D scene? I don't understand it from googling it alone

abstract raptor
#

Hi there. I'm getting an unslightly line beneath my main character sprite during animation, even though I've packed it into a texture atlas. Can anybody suggest a solution?

#

This is the character sprite sheet.

#

Filtering is set to point, there's no compression.

#

Wrap mode is clamp.

#

Padding is set to 8 instead of the default 4.

solemn latch
abstract raptor
#

That's the base file. I'm not sure how I can show you the atlas...!

#

There we go...

#

I'm also wondering how people normally do collision with 2D - do you do an entirely separate tilemap, or do you set up the collision for each sprite, or both?

abstract raptor
#

Finally, I've also ended up with some really bizarre 2D collision from the Tilemap Collider 2D...

#

Note the grass square to the bottom left of the bridge, just below the pink circle. This area should be walkable, yet I've ended up with a duplicate of the collision from the tile below it (a sort of lopsided trapezoid).

#

Can anybody suggest what to do here?

abstract raptor
#

Hmm. I seem to somehow have tiles under other tiles. Hmm.

#

Time to call it a night.

modest cargo
# abstract raptor

You'll certainly want to remove the sprite slices that don't have characters in them before creating the atlas

bold bluff
#

Performance-wise, is it detrimental to generate high-vertex custom outlines for sprites?

solemn latch
bold bluff
solemn latch
#

Well, generally speaking, rendering a transparent pixel is more expensive than evaluating several vertices. So if you can spend a couple extra vertices to cut out a big chunk of empty space, then you will usually benefit. That generally won't be what I'd call high poly though.

abstract raptor
#

Thank you @modest cargo , will do that in future. As this is mostly a test, I guess I'll live with that for now.

#

Folks, if I'm looking to put pixel art on a recent iPhone screen (so something like 1179 × 2556), but also ideally put it on an average Android and later to Steam, is there a procedure I should be taking to ensure the game looks roughly the same on all displays? I'd know what to do with Unity UI, but I'm new to working with sprites here...

#

Supposedly the latest Pixel phone is 2400x1080 (2.22:1)

snow ginkgo
#

Hi! Can anyone explain to me why should I create the sprites in an atlas instead of invididual sprites? In the case that you want to change the atlas rows/columns I guess it will be a problem right? That wouldn't happen with invididual sprites, or am I missing something

solemn latch
snow ginkgo
#

Yeah having them invididually and them create an atlas from them on Unity was my current approach but I see that a lot of people create them as an atlas directly

solemn latch
#

Well, a lot depends on your overall workflow. Building the sheet yourself also gives the most control, of course.

#

And of course, a lot of people use external software that exports as sprite sheets, so that's a good reason right there 😄

solemn latch
#

You can tile it, or create different versions for different resolutions.

gusty lichen
solemn latch
#

Depends on how you're overlayingit

#

you could also just nineslice with a tiled center

gusty lichen
modest cargo
# abstract raptor Thank you <@166982635950702592> , will do that in future. As this is mostly a te...

I'm not suggesting it just for optimization, but also to troubleshoot the problem
The sprite sheets colored background pixels should not be able to leak into the sprites when using a sprite atlas because of the margins, but it looks like it happens anyway
Without the excess sprites in the atlas at all, it would be impossible so if it still happens after removing them that means the atlas isn't being used for whatever reason

#

Note that you won't have to modify the sprite sheet for that, just select the sprite slices you generated in sprite editor and delete them, then recreate the atlas

sharp hedge
#

i am using a render texture with resolution 640 x 360 to get a more pixelated look, however, the color of urp/lit materials with emission appear very dull. how do i make the colors of emissive materials appear in the render texture like how it actually is in game?

modest cargo
#

Assuming that's how your project is handling high emission values

sharp hedge
gleaming perch
#

Hi! Does anyone know of a tool with which I can organize the assets of a sprite based game, to make it easier for my artist to make level and interior decorations. My idea is that there would be something similar to the tile palette but with assets organized by categories and perhaps if these could already be prefabs with characteristics (colliders, scales, scripts, etc) it would be better.

abstract raptor
#

I've moved onto a different sprite sheet now, but that was good advice, appreciated.

short osprey
#

Hi people! Is there an API to calculate the real bounding box of a Texture2D? For example a 100x100 texture all transparent with only a 20x20 speck of color in the middle, I would like to ask Unity and have it respond to me something like (20, 20) or Vector2D {20.0f, 20.0f}

short osprey
#

Meanwhile I came up with this kind of thing...

using UnityEngine;

public class VisibleTextureRect
{
    public int x;
    public int y;
    public int width;
    public int height;

    public VisibleTextureRect(Texture2D texture)
    {
        int imageWidth = texture.width;
        Color32[] pixels = texture.GetPixels32();

        int x1 = texture.width;
        int y1 = texture.height;
        int x2 = 0;
        int y2 = 0;
        int row = 0;
        int scan = 0;

        foreach (Color32 c in pixels)
        {
            if(c.a > 0)
            {
                if (scan < x1) x1 = scan;
                if (scan > x2) x2 = scan;
                if (row < y1) y1 = row;
                if (row > y2) y2 = row;
            }

            scan++;
            if(scan == imageWidth)
            {
                scan = 0;
                row++;
            }
        }

        x = x1;
        y = y1;
        width = x2 - x1 + 1; if(width < 0) width = 0;
        height = y2 - y1 + 1; if(height < 0) height = 0;
    }
}

it seems like working, but still, if there is something built-in I would prefer to use that. I tried to google with no luck before doing this.

thorny laurel
#

is there a way to replace a 2d animation with another sprite to not have to reanimate each sprite

#

someone mentioned this was possible but i dont know how

#

or i misunderstood

gusty lichen
abstract raptor
#

Is there a way to group select sprites in the Sprite Editor and change all their pivot points at once?

modest cargo
abstract raptor
#

Aah. I get you. Hmm. I'll look into that.

#

I'm having a situation where the 2D grid doesn't seem to match up with the objects in my Tile Palette. I'm currently twisting all the dials and flipping all the switches, but if anybody knows what's going on here, I'd appreciate a pointer.

modest cargo
thorny laurel
# gusty lichen i just replace the sprite in the originally used png in photoshop or whatever an...

I think we might be meaning different things. I kinda mean for making new characters. I'd like to copy the animation files from the previous character and then just use new sprite sheets on the current characters animation file, but if I were to replace it like how you're saying I think it would replace all of the characters with that sprite which is not what I would like. Just the current character for new character creation I would like the sprite to be replaced

solemn latch
jovial trench
#

Hello, importing 2d textures onto unity and ive been trying to find how to align the grid with my textures pixels

#

i found out the grid size should be 512 units. But there is this small offset that seems to being present that i cant figure out how to fix

modest cargo
jovial trench
#

How may I do this instead?

modest cargo
#

Have you changed any pixels per unit values?

#

Pixel perfect camera component may help with the rendering, and to place the sprites accurately on grid in scene view I would use grid+vertex snapping or type exact values for the transform position

merry torrent
#

Hello, is it possible to add a Physics Material 2D to Only One side of a Edge Collider 2D for a Sprite Shape? as shown in the picture? I looked everywhere but couldn't find an answer

lunar mist
#

im really new to unity so this may not be a good answer but i would use more than just 1 collider

#

.

anyone know how to get rid of the tile pallete selector
solved

merry torrent
#

I was afraid that was the only way, I hope there is another alternative as that would require a significant amount of time considering how many unique platforms I have in the game

uncut forge
merry torrent
abstract raptor
#

Does anybody have any experience using the Sprite Resolver / Sprite Library asset and component? I'm having trouble getting sprite replacement for characters in a Zelda-style 2D environment working correctly. I'm following this tutorial - https://www.youtube.com/watch?v=6mNak-mQZpc - and have reached 8.55 . I can add the Sprite Resolver properties and get the correct sprites keyframing in the timeline, but if I remove my original sprites from the timeline, I can't see the character at all in the Game view. Is there anybody out there with some experience with swapping out Sprite Sheets? (I'm going to have to leave my computer for about an hour, but if anybody has experience with this please tag me and I'll get back to you very soon...!)

In this video I will show you how to use 2D Animation package and its Sprite Resolver and Sprite Library to create reusable 2D animations.

Previously if we had multiple characters with exactly the same animation we have do create Animator Override Controller and recreate every animation using the sprite for the other character. This was a lot o...

▶ Play video
wraith bay
#

How can I attach a texture/shader to a sprite?
I got some shaders from the asset store and added them to my sprite renderer, but my sprites did not change at all.
what is going on

abstract raptor
#

Folks, I have a bunch of sprite sheets (about 16), all with the same grid spacing for characters. Anybody know how I can apply the same Sprite Editor slicing to a group of Sprite sheets all at the same time?

pastel abyss
#

hi folks, uber-noob here! just started this week and am having a weird issue with 2D Collision. The green boxes SHOULD represent the Tilemap Collider for the walls/door here, but instead they are reaching all the way out to this red area. My character can move just fine, but it is trapped within the red area. Nothing I am aware of indicates how/why this is the case. Any advice? TYIA!

pastel abyss
abstract raptor
#

Regards your problem, @pastel abyss , I had something similar just recently where I had multiple tiles overlaying each other on different 'heights' (see the Tile Palette). I deleted the offending tiles and replaced 'em with single non-collision tiles and it all worked out, seemingly. Not sure if that's your issue, but might be worth a shot...!

pastel abyss
abstract raptor
#

Yep, that was unclear, sorry. I'm referring to the Z Position, as can be found at the bottom of the Tile Palette - see here:

pastel abyss
#

I'm baffled. Completely restarted an entire new project from scratch, ONLY the PLAYER and the WALLS have any sort of collider on them. The FLOOR is on its OWN TILEMAP (again NO COLLIDER), yet somehow my player is stuck in a 5x8 grid in the center of the floor...colliding with NOTHING. Nothing shows up under contacts. 🫠

silver tiger
#

How do i determine what the origin cell of a tilemap is in the editor?

maiden forge
pastel abyss
#

yes. you can see in the image, the green boxes are the only colliders that should exist other than the player's own.

maiden forge
pastel abyss
#

yes

#

and a composite collider as well

#

(the green boxes)

maiden forge
#

Can you show a video or through pictures how you're placing your ground tiles in the world?

pastel abyss
#

the tiles were just hand-placed 1 by 1. for some reason, the colliders on the walls are reaching WAY farther than the boxes would indicate

maiden forge
pastel abyss
#

yes.....

maiden forge
#

No idea then.. try removing the composite? and see if it fixes the issue..

pastel abyss
#

i have already tried that... again i restarted from scratch lol its just for some reason the colliders are HUGE.

maiden forge
pastel abyss
#

i did already. the green boxes....

#

if its in the top result of google i have tried it lol thank you for trying tho

maiden forge
#

Maybe ask in a different channel so more people see it and see if someone else has a solution..

pastel abyss
#

that is what literally every channel says lmao i dont think this place will help with this problem

maiden forge
#

Maybe a weird unity bug.. What version you running?

pastel abyss
#

2021.3.16f1

modest cargo
#

@wraith bay .meta file contains sprite slice information in text form, so to some extent you can copy-paste settings between sprite assets

pastel marlin
#

Has anyone gotten Dragonbones to unity export to work recently?

willow reef
#

Can anyone help me put my damned tiled background BEHIND all the other sprites? I tried using sorting layers but it only goes behind the player and other game objects, not the floor or walls itself

uncut forge
pastel abyss
#

inspector shows that none of the player's colliders are in contacts with other colliders (outlined in green). Somehow the wall blocks are "larger" than they should be (red boxes). If I place only a single 16x16px wall with a box colllider 2d, it extends to cover NINE TILES... really dont get what is happening

solemn latch
short osprey
#

Or you have a script tampering with collider shapes and you forgot about it 😅

pastel abyss
pastel abyss
abstract raptor
#

Really, desperate for another set of eyes on my Sprite Resolver problem. If anybody has experience with this, or is happy to be my 'debugging duck', please let me know and I'll go over it in Discord...!

solemn latch
#

And other objects hit these enlarged colliders?

#

And if you set the box collider, can't you shrink it down?

abstract raptor
fallow flare
#

hello i have script for score and its correct but its not working and
I can't transfer to the marked location. how should i go about.

gusty lichen
#

so I'm having some sort order woes...I have a bed that i want my character to be under when he's on top of the tile, but I want him to be in front of it when he's below the tile. To make matters worse, I can't use the Transparency Sort Axis in Project Settings to solve this because I'm using another Scriptable Render Pipeline Setting.

Is there another way to get around this issue? 🙏 🙏

#

will I just need to change Sort Order on the fly with code or something?

elfin sandal
#

Why cant you change transparency sort axis?
If youre on urp you can still change it

gusty lichen
elfin sandal
#

Hm idk never heard of it

#

Have tried getting in contact with the aseet author

#

If its an asset

gusty lichen
#

Hmmm I can’t remember how I got it 😦 does the Universal Render Pipeline do light sources well enough? Maybe I could just use that instead

modest cargo
stoic island
#

Did we have a tool to create png spritesheet with transparency from animation in unity ? 2 years ago we had recorder something something but it never worked properly

gusty lichen
short osprey
modest cargo
gusty lichen
modest cargo
abstract raptor
#

Just run into this problem. I'm using 2D BRP, an axonometric pov (think 2D Zelda) and I have a bunch of spriterenders moving behind my character in a queue. Sometimes they'll be above my character, sometimes below it (in terms of Y) - and I want to have characters that are 'higher' in Y to render behind my character. I can think of how I could code this second by second, but surely this is an issue with some fairly standard solutions, given how many axonometric games are on the market...?

abstract raptor
#

...And there was, I changed the Transparency Sort Mode to Custom and set the sort axis to 0,1,0.

ornate spade
#

hey so i made a tile specificaly for this situation but its still using the other one

still tendon
#

are bones for 2d sprites removed?

#

im watching this guy make a characther and he just added bones and there doesn't seem to be any in 2021 version

elfin sandal
#

its a package you have to download

#

look up 2d sprite rigging unity

solemn latch
still tendon
solemn latch
#

Your tutorial might be incredibly out of date

#

Have you looked at the documentation?

still tendon
still tendon
elfin sandal
#

Look up tarodevs tutorial his is the best and most up to date

fallow stream
#

How can I make so that TextMeshPro also only appear in front to the mask, just like the sprite?

coral bear
#

hey guys, I am making my own Flappy bird, so I created a bird for the player, but when I imported (imported as .tga) it has small, so I change the scale but he look link this, and it's not supposed to look like this, how can I change it to look normal?

#

this is how its supposed to look like

#

Even not scaled it look like the first pic

lean estuary
#

turn off compression and filtering on the asset

coral bear
lean estuary
coral bear
#

really appreciated

glad nimbus
#

Why I'm getting this weird lines on my tilemap? I turned off compression and filter.

uncut forge
modest cargo
abstract raptor
#

Folks, I had a 4-direction sprite sheet for a character in a top-down 3/4 view and I have it setup with a 2D Blend Tree for animation - but when I move the character(s) in the ordinal directions, I'm not triggering vertical or horizonal animations. Any ideas?

pastel abyss
solemn latch
still tendon
#

So I created this prefab by combining multiple png files, I turn this into a sprite so I can use the Sprite Editor to add bones and stuff, but I can't add the prefab into the Sprite field in the Sprite Renderer component, anyone know how to?

abstract raptor
#

@pastel abyss - I tried adding more motions for the diagonals, but whenever the motions didn't exactly hit the diagonals, the characters would freeze their motions also. I was wondering if there was a way to increase the 'activation zones' (the blue pools) to ensure the interaction was captured or something, but it doesn't seem like that's possible in a useful way.

pastel abyss
abstract raptor
#

I've done this, but it seems to have just proportionally reset the activation zones...

#

Yeah, again, on test, the characters only animate sufficiently on ordinals.

pastel abyss
#

you arent utilizing anything on diagonals

#

also can you share your player controller script?

abstract raptor
#

Correct. So I only have four directions animated in my sheets, and I'm trying to set it up so that when moving in a diagonal, one of the four ordinal directions are triggered to cover for this, as you would have seen in old 3/4 Axonometric games in the past (eg. Chrono Trigger).

#

I'm happy to, but it's a horrific mess, as this is the first time I've been playing with Unity 2D in this way an I've been hacking stuff out.

#

Just tested setting the Horizontal values to .1, but that seems to be having the same issues.

still tendon
#

is there any alternatives to photoshop to create psb files for sprites?

#

could i use gimp?

abstract raptor
#

I believe so.

#

Hmm. Let me check that, actually.

pastel abyss
#

do you specifically need a .psb file or just a tool to make sprites?

abstract raptor
#

Yep, seems like, though you'll need to test in Unity to see how effective it is.

still tendon
#

what i did was i had a bunch of png's and combined them to make a gameobject

#

but i cant use the sprite editor because on the inspector, spire renderer, the sprite field is empty, i cant assign my game object as a whole (i tried putting in just the png of the torso thats why it says body there)

#

but then sprite editor only opens the torso part

#

every tutorial online makes a psb file and edits the sprites like that so idk what to do

solemn latch
pastel abyss
#

right on. .psb is an extension for photoshop files. you dont need that specifically

still tendon
#

what can i do in my scenario then

#

how can i add bones to my gameobject up there

#

i cant add the gam object "character" into the sprite field or the prefab or the object

pastel abyss
still tendon
#

yeah doesnt work tho

#

when the drag it onto the field it just goes gray doesnt allow me to put it in

abstract raptor
#

Still really stumped with this ordinal sprite nonsense.

still tendon
solemn latch
#

2d sprites don't 'blend' the way 3d transforms do

maiden forge
abstract elm
#

whenever i inport a tile for my tilemap it gets a white outline like this

#

how do i fix it? i am importing pst files from photoshop

abstract raptor
#

Forgot to say, @solemn latch , your advice fixed the issue. Of course Blend trees are dumb for this...!

solemn latch
maiden forge
abstract raptor
#

Oh, sure. Hey, that's vestigial from the previous version... and it ain't hurtin' noone (yet).

#

? Sorry, so that piece of code sets the parameters if there's any input. I'm not sure about the relevance?

maiden forge
#

Nevermind, haha.

abstract raptor
#

Was I missing something?

full breach
#

i dont know if this is the right spot to post this but is there any way to make the sprite fit the shape more? (its 3 seperate blocks)

solemn latch
spiral bear
#

Does anyone know how to detect when tiles are deleted/destroyed? Because I can Find all the tiles and the tiles that are null, but not when they are destroyed. Any solutions?

tough swift
#

Hello is anyone able to help me know why my rule tile isnt working with my tile palette

#

My tile rule is in my palette..

tough swift
#

just figured it out

#

just had to rearrange the order of them

still tendon
#

i want to make a celuar automata. I have drawn arows and created a tilemap and a pallete but when i paint on it the sprites are so tiny.How do i make so that the sprite fill the whole cell

#

and also if i want to acess a sprite in a tilemap with given x and y values will the z parameter be 0 or the z cord of the tilemap -1 in this case

graceful sand
#

why won't polygon collider 2d match the sprite?

short osprey
gilded ruin
#

Hey, u use Unity on Phone ?

ruby hinge
#

i have trees. the player. the backpack.

#

sorting layers dont seem to work the way i would have though

#

thought

#

if i put the player and his backpack on the same sorting layer. and the trees seperate. it still changes the trees?

#

I want the backpack to be behind the player

#

but when i set that up. all the trees are always behind the player regardless of position :/

uncut forge
elfin sandal
#

so when renaming a psd file to psd, do the layer IDs not transfer over?

#

when i'm in the skinning editor in unity i cant seem to be able to organize the sprites based on layer folders and such

#

anyone know a work around?

#

actually is there an asset that just does sprite rigging better than unity?

#

nvm
im an idiot

#

I didn't realize i had to click on sprite tab

spiral solar
spiral bear
#

@spiral solar No not really XD

spiral solar
#

I use it that way. I’m not at my desk but one of the two callbacks returns “synctiles” which return position and tile instance iirc. If instance is null then the position is where are deletion occurs. It’s in a free asset and works fine. Maybe you’re trying to do something else?

ruby hinge
#

it just treats everything like its in the same layer group

#

the engine seems to only care abut Order in Layer

#

does not change at all when using Sorting Layer

modest cargo
ruby hinge
#

doesnt work

#

it just doesnt behave the way it should

modest cargo
ruby hinge
#

and it still didnt work. but i found another fix

#

it was caused by URP messing with the layers

#

The sorting group component didnt work until i changed settings in the URP renderer

vapid cosmos
#

I think I have to rotate in LateUpdate()

solemn latch
#

If you are using an animator, then yes. Either lateupdate or ik.

unreal ferry
#

Is it possible to have two tilemaps? I want to use first for "ground" (so it has tilemap collider) and second for "background" (so it doesn't have tilemap collider)?

modest cargo
#

Or more

elfin sandal
#

when making a 2d skeletal rig that holds various different weapons, would putting all weapon sprites in the pbs file that has character sprites be the right way, or would it be better to have weapons be a game object that's a child of the hands. and the weapons object will have a sprite resolver

#

or is there no right way

#

for what its worth im planning on implementing various weapon types with each having their own swappable palletes

tidal turret
#

If I'm packing together my sprites in sprite atlases (4096x4096), does it matter if the original texture sprites are random, various resolutions, for example npot?

#

because Unity is basically only loading in the sprite atlas into the game yeah? So it's pretty much "leaving" the raw texture files behind.

orchid oyster
#

I'm pretty sure this is easy and/or there's a video that easily explains this. I just don't know what to look up. I want to put a sprite ontop of another and have it slowly fade in/out of the one it is against in the same animation. Does anyone know what that is or what I should google?

misty ore
#

hi there, just wondering why the tiles in my tilemap appear so small?

#

fixed it, just had to make a new palette and add the assets one at a time

maiden forge
rich gyro
#

Hello, i am trying to get the height and width of a texture2D but unity always limits the texture to 2048x1024 although I changed the MaxSize in the settings of the Texture to 4096. Does anyone know why?

rich gyro
modest cargo
modest cargo
modest cargo
modest cargo
still tendon
#

Another question comes up in mind How can I Test my game on my android on iMac in unity? Is Therme anything ? And what do i need to do to make up a Good Quality of my game, so the graphics should bei Good tho

zenith laurel
#

Probably something super simple but the preview for the pixel perfect camera shows my background filling the whole screen but when I hit play it zooms out and only fills a portion, what might be causing this?

lone steeple
#

Hey guys. I'm trying to make a dungeon generation system. I have different tilemaps as prefabs with rooms drawn on them. Will it be a problem to spawn multiple tilemaps in a scene? if it is a problem how would I make it so that it copies those tilemaps to a tilemap from prefab?

modest wren
#

Ive recently started running into a rendering bug with my tiles. The first image is what my assets look like when implemented into unity, while the second image is what they should look like. My images are being rendered with a single sprite mode, and they are set to filter mode point. Any ideas on what is occurring?

zenith laurel
#

I’m not sure if it will change anything but it might be worth a try

modest wren
#

thank you!

#

that just fixed it

#

seems to be a facet of how unity reacts to low pixel objects

misty ore
misty ore
#

It just didn't like importing every image at once

modest cargo
misty ore
#

Yeah, I didn't even know why it happened honestly

spring oar
#

Question

#

Do i come here for 2d animation help?

modest cargo
# spring oar Do i come here for 2d animation help?

If the question fits many channels, post it where it seems most relevant
If it isn't relevant after all you'll be directed elsewhere
If it takes a long time without anyone responding, you can post the question to another relevant channel for perhaps a different set of eyes on it

#

On the surface "2D animation" is both 2D and animation relevant

spring oar
#

ok

lethal turret
#

anyone have any wood texturing examples? and also how I can make this window frame look better? Having a hard time trying to figure it out

gilded wadi
#

When importing tilesets, the automatically generated physics shapes are always extruded off of surfaces, even when the sprite is extremely simple like this. Is there some setting you can change to fix this? I know you can manually set custom physics shapes, but this would save a lot of time and effort

crisp delta
#

hi, why my 2d texture has black things on the Unity editor but in paint.net it doesn't has them and also on the preview in the inspector ?

#

ok nevermind I found why, I just put a custom material on it that adds outline

graceful sand
#

how would i calculate the camera size to not get something like this?

#

the tiles are all the same but you can see the ones over to the right have the outlines more prominent

graceful sand
#

nvm ended up using pixel perfect camera and some other compromise

elfin sandal
#

omg so when using 2d animation rigging, if you try to have a child of a sprite it wont get moved

#

and you can't change the sprite to something that isn't part of the psb file

#

what an awful system

#

and if you sprite swap a skinned sprite it won't transform based on the root bone

#

however if you sprite swap with a sprite from a completely unrelated skeleton it will work just because the sprite is associated with a bone

#

awful awful

solemn latch
#

@elfin sandal yeah. All problems I've complained about =p

elfin sandal
#

more people should complain lol maybe they'll listen someday

#

but i found if i just go to skinning editor on a random sprite and place a bone on it then replacing sprites will work

#

so dumb that it has to be done that way

#

should just be able to use the pivot

solemn latch
#

Yeah

#

It is obnoxious, but it feels like whoever did the sprite swapping never tried using it with a real project

still tendon
#

Another question comes up in mind How can I Test my game on my android on iMac in unity? Is Therme anything ? And what do i need to do to make up a Good Quality of my game, so the graphics should bei Good tho

maiden forge
fathom wedge
#

why are my tiles like this

still tendon
#

hello,

#

iam working on a 2d game , and i want to add a character to my scene

hoary basin
#

Hey, im dragging a rule into the tile palette but i cant see the default sprite

#

However the Palette shows the prefab in the project window

#

Shouldnt the default sprite show?

#

here´s how the rule looks

grand summit
#

I have a tile sheet where each tile is 32x32 pixels but when I try to slice it into individual tiles it slices each pixel. How do I slice the tile instead of each individual pixel of every tile?

solemn latch
hoary basin
solemn latch
#

Your first rule. No sprite there.

analog widget
#

hey guys, anyone know where i can find a good pathfinding package for unity?

#

navmesh plus seems to be broekn

#

either that or my unity version is unsupported

minor igloo
#

Hey, i have a tilemap in which i got different tiles. I want to have a specific tag to my platform's tile, and a different tag for the ground's tile, is there a way to do that?

normal plume
#

Hi, I'm using a 2D Texture sprite on a quad on the top face of a cube in a 3D game with URP. I have the quad's material set to transparent (this works) and I want to "paint" on the texture using SetPixel(r, g, b, a) in such a way that the paint is not transparent.

When I try to set per-pixel transparency (that is, a=1) in this way it has no effect at all, although the r,g,b values are adopted, and the alpha channel of the pixels is unaffected. Here's a picture of a test scene - the cube stripes should not be visible through the paint but they somehow are, although the (r,g,b) value of the paint is applied and obliterates the Unity logo on the right.

Here's my core splat function on the paintbrush. Can anyone see what I'm doing wrong?

    private void RayCastSplat()
    {
        var rayStart = _splatRay.transform.position;
        var rayDirection = _splatRay.transform.forward;
        float rayLength = 1f;

        RaycastHit hit;
        if (!Physics.Raycast(rayStart, rayDirection, out hit, rayLength))
            return;

        Renderer rend = hit.transform.GetComponent<Renderer>();
        MeshCollider meshCollider = hit.collider as MeshCollider;

        if (rend == null
            || rend.sharedMaterial == null 
            || rend.material.mainTexture == null
            || meshCollider == null)
            return;

        // texture has been cloned in Start to avoid messing up original
        Texture2D tex = rend.material.mainTexture as Texture2D;
        Vector2 pixelUV = hit.textureCoord;

        var px = (int) (pixelUV.x * tex.width);
        var py = (int) (pixelUV.y * tex.height);

        // hopefully the compiler unwraps these loops (how to verify?)
        var padding = 2;
        for (int i = -padding; i <= padding; i++)
            for (int j = -padding; j <= padding; j++)
                tex.SetPixel(px + i, py + j, _color);
        
        tex.Apply();        
    }
still tendon
#

can someone explain why my texture does that ?

#

there a bit of overlap with the side texture

civic knot
normal plume
#

I want the material to be semi-transparent but then I want to locally vary the actual alpha

civic knot
#

Okay, the texture color does not override this value. It's multiplied by it, so you'll never get an opaque color with the base map color not being 1.

normal plume
#

ah wow, ok, need to experiment some more with that, thanks

civic knot
#

What you could do is edit your texture to be half transparent instead of changing the base map color. Then when you paint, your alpha would be the actual alpha.

normal plume
#

interesting, thanks, haven't tried that - don't know how to do that actually but will find out. The texture is just a screen grab in windows (I think it was saved as a PNG file)

civic knot
normal plume
#

I'm still concerned that this is what I'm doing already when I call .SetPixel on the texture. I understand that multiplying the alpha will clamp my observed alpha, so when I use a material with alpha 0.5 maybe I can't go outside a=[0,0.5] range but still would have expected the SetPixel call to do something ... I tried different values from 0 to 1 ... but anyway thanks for the input, will test.

civic knot
#

Does it not become completely transparent at 0?

normal plume
#

correct, even zero, testing it now - I'd have thought with zero I'd make the pixels transparent

civic knot
#

Hmm

#

Can you take a screenshot of the texture import setting?

civic knot
#

Okay. The settings seem to be fine. How do you set the _color value?

#

Although, do try disabling the mipmaps and see if it changes anything.

normal plume
#

serialized in the inspector, so I can play with the alpha (testing mipmaps now)

normal plume
civic knot
#

Hmm

normal plume
#

that's basically the same but with three paintbrushes all alpha=0.0 but color r,g,b

#

I wonder if this is some URP devilry

civic knot
#

Well, I'm out of clues. If you want I could look at the project when I have some time. If so, upload it to GitHub or something and share the link.

normal plume
#

thanks that's a very kind offer, let me see if I can figure it out but thankyou for your input

hollow crown
still tendon
hollow crown
#

Then presumably the problem is the padding you have set up in your sprite

still tendon
hollow crown
normal plume
# hollow crown What's the material used for the overlay, and what's the (presumably a) render t...

I went into a bit more detail up here:
#🖼️┃2d-tools message
but it's not a render texture; there's a 2D Texture applied to a material on a quad, which sits on top of the cube (the only purpose of the striped cube is to have something distinctive behind the quad so I can see variations in the alpha). The material on the quad is a 50% transparent Default type 2D texture; here are my complete settings and I haven't changed the code from what I posted above. So the puzzle is: if transparency is working for this setup, why can't I vary the per-pixel transparency of the texture using SetPixel(r,g,b,a)? Even setting a=0 seems to have no effect. But (r,g,b) does have an effect, that's how the paint is applied.

#

Basically if it was doing what I'd expect, at a=1 you would obscure the stripes on the cube in the background. and at a=0 you'd hide the Unity logo (by making it transparent) where you painted.

hollow crown
#

You have a lot going on and none of it is very clear to me which layer it's applying to.
Issues:

  • Transparent is generally not good for anything other than glass. Often you want Fade instead.
  • The color field next to the texture will multiply with the color values, including alpha, so if your other material also has that, it won't obsure anything.
  • If the quad and the cube are both transparent, sorting will occur by the center of the objects, not via their actual depth. So it's likely at certain angles the cube renders above the quad.
  • If you want to render something as 100% transparent and 100% opaque, use a cutout material (the material should be marked as opaque, and then it will sort properly)
normal plume
#

OK, thanks for the suggestions...

  • I only see Transparent & Opaque as options for this material
  • The cube is opaque, I want to be able to vary the per-pixel opacity of the quad on top (with the Unity logo) which is 0.01 above the cube's top.
  • a cutout material may be exactly what I want and I will look into that, thank you
hollow crown
#

Ah, it's Unlit. Transparent is fine, Cutout is ideal
If the above material is what you're using for the quad, then the issue is that you have 0.5 alpha, which is multiplied with your rgba values

normal plume
hollow crown
normal plume
#

Ah now we might be getting somewhere - that might be the issue, or almost... I added an alpha channel using GIMP but that didn't quite work yet, I still can't adjust the alpha using SetPixel. Unfortunately I have to stop for the night but I have learned some stuff... I'm optimistic that I will fix this. Thanks for the discussion @hollow crown

hollow crown
#
  • Just also make sure you've actually debugged the color value you're sending just to be sure something isn't totally borked
still tendon
#

ok i'm out, it dosen't make any sense

#

WHY DOES IT CHANGE IT RANDOMLY

#

it's not even taking the tiles in

#

oml

solemn latch
#

@normal plumeare you using color or color32?

dreamy belfry
#

hi, I'm new to Photoshop and Unity and I was making the sprite (in pixel art I guess?) for my first 2D game. the problem is the file is 25x25 and it looks bad when put in Unity. how can I solve this?

modest cargo
#

Generating a texture atlas has the option to generate padding as well, to avoid the effort of modifying the sprite sheets manually

normal plume
solemn latch
#

In your script, the color you are drawing.

#

They can be implicitly converted between but are very different.

#

For instance, an alpha of one would be solid for one and almost invisible in the other.

modest cargo
#

<@&502884371011731486>

timid plover
#

!ban @dry ingot hacked account

barren orbitBOT
#

dynoSuccess Chocola#7774 was banned

zenith laurel
#

I’m working with the pixel perfect camera and trying to work out resolution, why does (in game view) it appear cropped in 16:9 despite the fact that it is filled out in Full HD

#

To clarify I do have crop frame x and y enabled, I was just under the impression that it only cropped when outside a specific ratio and to the best of my knowledge 16:9 and full HD have the same ratio

lost turtle
#

how would i make it so the player cannot go into the water and only stay on the tilemap? as if the tilemap has a "hollow" collider

modest cargo
still tendon
#

I need character, anyone can help?

abstract olive
#

You can commission art online. Otherwise, this isn't the place to ask for free work if you can't find free stuff online.

peak jewel
#

Btw does anyone know if you can use tilemaps for just a background?

still tendon
willow reef
#

Hello everyone, I know I may sound like an absolute douche for asking this but I really need help on my new character design and I would appreciate if someone made 3 more textures for my character

#

My character is unfortunately 256x256 which is why it may be a pain

#

If anyone can help I would I appreciate it

#

If it's too much I will back down and do it myself as I know it is my model

barren orbitBOT
willow reef
#

Oohh

#

That clarifies everything

#

Nevermind then

analog widget
#

Is there a way to make objects hide behind shadows?

#

Also how can I make a shadow shape out of a tilemap collider?

karmic stump
#

How to get Motion Blur working with Post Processing on 2D Sprites moving and a static camera? Builtin, Post Processing v2

celest tree
#

With the unity tilemap is it possible to just fill tiles with a solid color instead of using a spite image?

#

And have it fill the whole tile, even if you resize the grid

elfin sandal
#

no

elfin sandal
#

when I try to getcategory() from sprite resolver it's returning null
actually my resolver's category is getting set to none as soon as the scene starts for some reason

#

but even if i set the category myself it gets reset

#

well, I can get the category at start and save it to a string
dumb as fuck that it has to be done this way

wet spruce
#

why when i export my pixel art it changes color and how to prevent that?

uncut forge
wet spruce
#

ohh i forgot about the compression, thanks

upbeat edge
#

Anyone know how I can change the offset of my tiles to give the illusion of animation here? Or if this is even possible? The water tile is perfectly tiled, so I figured this might be easier than actually doing it pixel by pixel.

solemn latch
upbeat edge
#

I suppose it was about time I got my feet wet with shaders

spiral solar
thorny laurel
#

Hello I tried to make some tile pallets but for some reason when I paste in my sliced sprites the tile pallet shift everything on a diagonal

#

this happened a few times

#

idk what ive done wrong

thorny laurel
#

another example

#

i dont understand

#

may i crosspost this to main

maiden forge
# thorny laurel Hello I tried to make some tile pallets but for some reason when I paste in my s...

Did you get this problem fixed?

Also what version of Unity you have running? Because I think this issue was fixed in Unity Verison 2020.1

There was a whole forum post about it here: https://forum.unity.com/threads/solved-weird-positioning-of-tiles-in-tile-pallette.508296/

thorny laurel
#

and no I have not gotten it fixed but I will check this out

#

thank you

maiden forge
#

You're welcome and good luck.

spring isle
#

how do i keep the background on the camera?

thorny laurel
#

there was a fix in there

maiden forge
spring isle
thorny laurel
#

should creating a sprite pallet literally take one second per split sprite

maiden forge
thorny laurel
#

i have a good system

#

and its of course a large sprite

#

i have a ryzen 9

#

laptop ryzen 9

maiden forge
#

Could be Unity bro, not 100% sure so I cannot really say for sure.

celest tree
#

I have a hexagon tilemap; what equation could I use to get all the surrounding tiles at N distance?
Currently I have this function to get the adjacent tiles; but I need to be able to also get them for any given distance (not just distance = 1)

public static Vector2Int[] SurroundingTiles(Vector2Int tile, int distance = 1)
        {
            if (tile.y % 2 == 0)
            {
                return new Vector2Int[]
                {
                    new(tile.x - 1, tile.y),
                    new(tile.x + 1, tile.y),
                    new(tile.x - 1, tile.y - 1),
                    new(tile.x, tile.y - 1),
                    new(tile.x - 1, tile.y + 1),
                    new(tile.x, tile.y + 1),
                };
            }
            else
            {
                return new Vector2Int[]
                {
                    new(tile.x - 1, tile.y),
                    new(tile.x + 1, tile.y),
                    new(tile.x + 1, tile.y - 1),
                    new(tile.x, tile.y - 1),
                    new(tile.x + 1, tile.y + 1),
                    new(tile.x, tile.y + 1),
                };
            }
        }
#

There must be some mathematical way to do it, other than just doing function like this in multiple iterations.

craggy kite
#

lets continue here 😄

#

@willow reef make thread so its a bit organised

willow reef
#

sure

#

Sprite Render issue

willow reef
#

you there?

green jewel
#

Hello, I am testing the tile rule and I was wondering if it is possible to make two different types of tile rule interact as in my example image, with one side of stone and the other of earth (I wish they would stick).

I hope to be in the right place to ask ^^

sweet trench
#

I dragged in a sprite that wasn't the size of 1 cell and all my cells resized, how do I fix this?

ps this is the tile palette

tender breach
#

Hi.
Can I crop sprite with mesh type full rect and sprite mode single and get new center?

maiden forge
woeful seal
sweet trench
#

I did, it's just that the ones I tried to drag in were larger than 1 cell yet still got shoved into 1 cell

maiden forge
#

What do all use for 2D sprite drawing?

#

Or just 2D drawing in particular..

celest arrow
#

Does anyone know of a way to take a sprite sheet png and automatically split it into separate png files. Not by tile size like slicing, but it cuts out the individual sprites? I have a large sprite sheet that is component based and doing it by hand is taking forever.

All of the individual sprites are different sizes.

Edit: In case anyone else is in need of this someone pointed me to https://github.com/ForkandBeard/Alferd-Spritesheet-Unpacker/releases
Works great so far on every sheet I've tested.

GitHub

A spritesheet unpacker/ ripper for Windows. Contribute to ForkandBeard/Alferd-Spritesheet-Unpacker development by creating an account on GitHub.

polar sinew
polar sinew
uncut forge
maiden forge
#

Thanks everyone! 😄

thorny laurel
#

idk what's wrong

#

or how to fix it

maiden forge
thorny laurel
#

Idk

maiden forge
#

Seems to be decent info on this forum post

acoustic nacelle
thorny laurel
thorny laurel
#

alright my idea i said in the unitytalk chat worked i think

#

i just remove all other pallets while importing

modest cargo
#

!collab

barren orbitBOT
still tendon
#

!collab

barren orbitBOT
still tendon
modest cargo
uncut forge
#

That's what I was about to ask

exotic vessel
#

would anyone have tips or advice how to draw an attack animation while also incorporating it into movement? i just cant figure out if i should draw a walk, walk-attack, and attack animations or just an attack animation, any help would be nice :]

modest cargo
modest cargo
# exotic vessel oh ok, thank you

You could describe in more detail how attacking works in your situation, but either way your best bet is looking at how other games with similar styles do it

exotic vessel
modest cargo
#

Most games I can think of with long winded melee sequences don't allow the player to move during them

kind yacht
#

Idk where to put this, but is there a way to make a model invisible and only the texture? Making some sort of 2.5D

wind socket
#

hello there friends! I've a question about pixel perfect game development. I was beaten by that last time I tried and focused on oher parts of game. However I do not want to delay this problem anymore - I've setup pixel perfect camera that is scrolling upwards constantly.

However, this makes weird jitter every several frames and I cannot figure out how to deal with this. Was looking for solutions on google, but could not find anything.

I've included movie how it looks like.

#

I have tried putting camera movement into lateupdate but it doesnt help. I could probably store camera position in separate field and round transform Y position to nearest 1/16 value (to match PPU) but I'm sure there must be a better, more correct way to do it.

elfin sandal
#

you mean the jitter in the UI?

#

if I remember correctly the way I fixed it was by downloading a UI extension

#

forgot what it was called tho

elfin sandal
#

does anyone know how to properly do a rule for diagonal tiles?

#

i want the top one to look like the bottom one

modest cargo
elfin sandal
#

crazy how I can't find anything about this when I look it up

solemn latch
#

You can always just manually place a tile too.

elfin sandal
#

yeah, but if I wanted really long levels it'd take a long while

#

they always say dont reinvent the wheel
but apparently the wheel hasn't been invented for this problem

uncut forge
modest cargo
solemn latch
elfin sandal
#

Its not the only combination i tried

solemn latch
#

I mean, this seems like an obvious omission

#

The way you have it set up, the first rule will always have priority.

elfin sandal
#

ok that works

#

i didn't know that their positions meant priority

still tendon
#

any idea

#

why this happens

#

?

solemn latch
still tendon
still tendon
solemn latch
#

I mean you used three lines and still managed not to say what you need help with?

still tendon
#

quite distorted

#

i was hoping to understand the reason.

solemn latch
#

I'm on mobile so they look identical to me. Probably your compression settings in unity.

still tendon
#

where can i change them

solemn latch
#

Your compression settings in unity.

elfin sandal
#

When yu inspect the sprite

timid bluff
#

Does anyone know what the best way to implement hazard tiles (like spikes) would be? In my previous project, I just put spikes on a separate tilemap and checked for collision with that but I'm wondering if there is a better solution?

timid bluff
#

I was thinking of using scriptable tiles though I'm not exactly sure how I'd implement it.

#

Okay, I decided on using a GameObject brush to get the advantages of grid snapping without having to deal with tile-related shenanigans.

elfin sandal
#

i would make it so whenever the player collides with the tilemap collider it checks what tile is at that position and if the tile name is spikes then damage the player

timid bluff
elfin sandal
#

👍

still tendon
#

any tools to edit batches of images? I just want to change basic image properties like saturation, brightness and contrast and maybe vignette if possible?

still tendon
#

nvm I downloaded an extension for gimp that does it^^

uncut forge
still tendon
compact jetty
#

How do i get the actual camera view to align with the pixel perfect green box?

solemn latch
#

Use a pixel perfect camera the same size as the box and put it in the same position?

kind yacht
#

for a tilebased game, how would I make a grid?

uncut forge
#

grid component?

kind yacht
#

but like what would I add the component to?

solemn latch
#

A game object

kind yacht
#

how would I make other objects move and scale by that grid?

elfin sandal
#

easily googleable

little kindle
#

I don't know if this is the right channel (I'm assuming it is), but you can see in the first picture there's a little sword that is to the right of the big sword. I did not put that there and it's not in the hierarchy, but it does have the same sprite as this prefab (second picture).

#

does anyone know why that little sword here

#

he's just standing there menacingly

#

also I can't click on it in the scene

#

I saved the project, restarted unity, and now it's gone

#

that was strange. If anyone does find an answer though it would be nice, cuz I am curious how the heck it got there

loud grotto
#

Hello, how can i give an npc a decided path to follow?
I need to give an npc a specific path to follow, which includes jumping and falling. I would need it not to follow the player, but to go direct. I was thinking about NAVMESH, but it follows the player. Advice?

solemn latch
#

Really an #🤖┃ai-navigation question but you can use pretty much any method, and just periodically update the goal position.

polar basin
#

My slicing goes on very imprecisely, why is that? Here's like a 13x13 selection but you can see that there's only a little chunk in the left and a too big one on the right

still tendon
#

I really didn't think it'd be this difficult but how does one create their own custom tiles? I got an asset package from the asset store but it's missing a regular black tile and I'd like to make it myself. What I've found online is for either scripted tiles or rule tiles

polar basin
still tendon
polar basin
still tendon
#

That's my tile palette

#

However I want a tile that's all black (same black those tiles)

#

And I can't figure out how to create one

polar basin
#

Well

#

Get a black sprite

#

And do what I said

still tendon
#

Got it

solemn latch
#

You ask in the correct channel.

radiant grail
#

Does anybody know any good online softwares that are very good for creating 2d sprites?

solemn latch
#

I'm sorry, nobody does.

ember lark
#

light2d, why's the yellow line flat? it's usually a full circle

thorn star
#

not certain where to put this, but i feel it belongs here? I have discovered an odd quirk with the orthographic camera, it is that if an object has a higher y than the ones surrounding it, it gets given a black outline by some imperfection somewhere... Is there a workaround?

lean estuary
#

If alignment is slightly off or imperfect pixel per unit setting might allow bleed in from the border. Hard to say. Pixel perfect camera usually fixes looking through seams thing. But I've had it work without it with tilemaps as well.

thorn star
#

ok thanks, i will look into that stuff then!

lean estuary
#

One workaround to fix it is to make tile slightly larger to cover bleed in. But ideally you could match it perfectly.

thorn star
thorn star
thorn star
lean estuary
#

does the tile have any compression or antialiasing on the asset?

thorn star
lean estuary
#

That looks like something under the tree bleeds in though not the tree itself

thorn star
#

there isnt anything underneath the tree, with my current setup i can only have 1 tile per place

lean estuary
#

And that's a game view and you don't have any gizmos enabled?

thorn star
#

as far as im aware

lean estuary
#

It frames exactly the tile under it

thorn star
#

yep

lean estuary
#

don't seem to be related to the tree

thorn star
#

the black border thingy is exactly where the transparency in the tree starts, hence why i would think it was the tree...

lean estuary
#

Yea, that looks like an asset artifact. Cleanup edges.

thorn star
#

how would i cleanup the edges?

lean estuary
#

make sure you don't have semitransparent anything around it. You can see the top part of it is just fine

thorn star
#

none of my sprites have anything semitransparent as far as i know, I'm quite a noob to drawing pixelated sprites so i've been sticking to either 100% or 0% opacity for all pixels

lean estuary
#

Right, you are scaling it and it is mismatched, the thing is not pixel perfect anyway, so make it larger to cover seams

thorn star
#

ok, thanks so much!

lean estuary
#

you could also have background of the same color so it would help hiding it

thorn star
#

ooh, like using a solid colour sky box?

lean estuary
#

Yes. Also you could have a second tile grid to separate tiles from trees, you'll have more freedom with their positioning

thorn star
#

fascinating, ill keep that in mind, as that sounds cool, thanks a ton!

lean estuary
#

because you will have problem drawing object on that tile, they can't be sorted like this

#

that is if you want for something to appear in-front or behind the tree while standing anywhere near it

thorn star
#

not quite certain what you mean there, but currently i use y to get things to render over or under eachother, which seems decent atleast for now lol

lean estuary
#

if you have a floor attached to a tree, you can't exactly draw something behind it, the floor will be drawn on top of it if you do

thorn star
#

my tiles are all individual currently, they cannot be attached to eachother, but should that ever change ill keep that in mind

celest tree
#

I'm currently trying to learn the 2D Sprite rigging. I have a question if you have a .PSB where you want multiple variations of a layer. (For example 10 different hair styles). I can use a Sprite Library and Sprite Resolver to switch out the sprite for the hair. The problem is that I have to rig every single hair sprite. (Even if it's copy and pasting the rig this is still a lot of work if you have a lot of different variations). Is there a way to do it while only making the rig once?

#

If you put all the layer variations into 1 PSB and do auto-weights this works ok, but the problem is if you need to weight paint...because it seems you can only weight paint one layer at a time?

elfin sandal
#

nope, just a quirk of the system

#

bones need rigged sprites to move them so it can't be helped

kind yacht
#

whenever I make a tilemap, the tile is always bigger or smaller than the grid. How do i get around this??

static violet
#

Hey so I have this character
I am wanting to create a physics based tail for them rather than animating it by hand

There are 2 approaches to this that I'm considering:

  1. a code based approach, where I set the offset that each segment should have from the previous segment, and Lerp the value to create smooth movement. This is how Madeline's hair works in Celeste.

The drawback to this approach, is that I have to define alot of offset values that are not very intuitive to figure out initially. The advantage however is that I can have very direct control over the psuedo-physics here and not have to deal with blackbox unity components/systems, and I wont run into any unexpected behaviours.

  1. create some sort of spline, chain, link? I'm not sure what component to use exactly for this, but I know there is one that would suit this task perfectly. Disadvantage is that I have to control its behaviour through the component, which involves tweaking and fine tuning values, and depending on situations or behaviours I want, it could be very difficult to get it to behave the way I want.
    The advantage to this approach is alot less initial work.

I'm just looking for others thoughts or opinions on this, or how you would do it if you could think of a different approach

solemn latch
static violet
#

I do think there are components for this, like it wouldn't be much different than making a chain

solemn latch
#

Well, I suppose it depends on what you're doing. For instance, built in 2d physics don't play very well with animators, while spring bones need some script updating to get working since anima2d was depreciated. If you need squash/stretch rather than a rigid chain, that is an additional consideration.

static violet
#

I'm aware of animators vs physics. I dont use the animator for any of my movements, all of it is done via a 2D player controller on a kinematic rigidbody2d

#

hard coded psuedo physics

modest cargo
# static violet I'm aware of animators vs physics. I dont use the animator for any of my movemen...

If the position of the tail's attachment point changes without inertia or teleports, such as when flipping the sprite or jumping, then a physics based system is likely to flip out
I think your best option is to code propagating motion on a chain of transforms, using something like this
https://youtu.be/9hTnlp9_wX8
There's many ways to make object chains depending on how it needs to work, and I can promise you'll be "tweaking and fine tuning" a lot regardless of the path you choose

#

After that you have the choice of representing the tail with multiple sprites or a line rendered along the tail points which is then pixelated in post

static violet
# modest cargo If the position of the tail's attachment point changes without inertia or telepo...

instant teleporting would cause issues with a physics based approach for sure, but I think this can be overcome by using code to clamp the max distance each segment can be from the last one. I expect fine tuning in any case, but getting it to work initially is going to be a task

in any case, I've been thinking on it all day, and I want to pursue the hard coded psuedo physics if I can get it to work.. that video you linked looks really relevant, and I'll give that a watch too

#

Ive also had a pixel perfect camera component on for a long time, but I'm finally considering taking it off, because the benefits it provides are starting to be outweighed by its drawbacks

#

and all the assets I've made are already to pixel scale anyways

solemn latch
#

Oh, and of course there is also the option to just draw six tail pose variation sprites and swap them based on the velocity 😄

static violet
#

I did it

#

even got a bit of code in there to control the tail wagging on running and idle states

#

I ended up going with the Celeste-like coding method

solemn latch
#

Looking good

#

Oh yeah, and that actually is one of the things that the built in 2d physics is bad at- changing character direction. The coded version makes quite a nice transition. 😄

solemn latch
#

I actually had trouble with that for the tail of my first character 😄

crystal flax
#

I want to detect what tile I click on using tilemaps. I can do this (pseudo):

//
//
tile = tileMap.GetTile(position);```

This way I can detect the tile I click on at the tileMap I assign from the inspector. But I have multiple tilemaps so I'm not sure how to detect it without assigning a tilemap first. Thanks in advance
modest cargo
# crystal flax I want to detect what tile I click on using tilemaps. I can do this (pseudo): `...

I think you've got two approaches generally

  1. Detect the tilemaps under cursor first. I'd like to use OverlapPoint but since that doesn't return the results I think the option is a Physics2D.Raycast check that's the length of zero or very short, then do GetTile only on the highest poisition Tilemap
  2. Have all references to all Tilemaps to start with, do GetTile on a loop on all them sequentially that stops as soong as it finds a tile at that position
crystal flax
#

...

#

that makes perfectly sense

#

Thank you. I already have tilemap references, I'll give the second one a try

shut fern
#

Anyone know how to export a level tilemap from one Unityproject to another?

modest cargo
flat gyro
#

When ever I import a sprite sheet everything gets corrupted, there will be blue splotches on the face and other splotches of colors, it's not the software I use or anything I checked various times so I think it's unity.. can anyone help?

modest cargo
flat gyro
#

Ah ty I'll check that later

paper pendant
#

so I'm trying to programmatically make an isometric wall

#

and it works as a single layer, but if you do a dual layer (i.e. attempt to add height), it does this. I'm guessing its due to sort axis' and rendering order but I'm not sure. Does anyone know a workaround if there is one?

inland tendon
#

anyone know a good tool for making 2d spritesheets?

#

I wanted to use paint.net but unity apparently struggles to read that format

paper pendant
paper pendant
#

Its the 2d art program, no lie. does animation even

paper pendant
#

yeah or png

#

asperite is pretty awesome still tho, its like 20 bux for a suite of tools that slap

uncut forge
#

Can unity use vector images?

inland tendon
#

can someone tell me what's going wrong here? I tried making the image to the right in photoshop, but when it was imported it became the image on the left.

uncut forge
#

Set filter mode to point, and compression to none in import setting for the image in unity

inland tendon
#

!

#

love you

flat gyro
inland tendon
crystal flax
#

is there a way to prevent placing sprites on top of each other using unity's tilemap?

flat gyro
plain bobcat
#

anyone know how to have a shadow caster 2d on a tilemap??

vapid jewel
#

i can't see any sprites rendered in my scene view.
using latest unity 2023.1 beta and URP..

does anyone know how to fix this?

solemn latch
novel timber
novel timber
static violet
#

do you mean eliminating tears in the tilemap?

#

look into Pixel perfect camera scripts

modest cargo
#

Gaps in tilemap can be fixed by pixel perfect rendering
Gaps of color in tilemaps may be fixed by that as well, but the root cause is lack of padding between tiles on the sprite sheet

analog widget
#

is it possible to make the shape of a shadow caster the same shape as a tilemap collider?

floral siren
#

hey I have trouble understanding how do i set my game window to be exactly 320x180 in unity, cam anyone point me in some direction? I did set the game view to 16:9 but it'd like it to set it to the mentioned resolution so that it fits 40 tiles in width (Ive created 8x8 tiles). Am I missing anything or do I have to just manually resize the window to fit as many tiles as I want

novel timber
modest cargo
novel timber
modest cargo
#

for ultimately producing pixel perfect results

novel timber
#

i cannot fully understand what you are saying

#

english is not my native

#

What to do if i want the camera size to stay at 4.8? As soon as i click "Run In Edit Mode" in pixel perfect camera it changes to 4

modest cargo
#

There is no simple answer to that because it depends on pixel perfect camera's reference resolution

novel timber
#

so i just need to test it?

modest cargo
#

I don't actually recommend using the pixel perfect camera if your goal is to just fix the color bleed between tiles

#

It's a good system for what it does but it takes a lot of learning and it has its limitations

#

If you only want to fix the color bleeding, then you need padding between tiles on the sprite sheet as I originally mentioned

novel timber
#

How do i set that up

modest cargo
#

A. Modify the sprite sheet in an image editor so that each tile has 1 pixel of padding in each direction
or B. Generate a sprite atlas in Unity which has the option to add padding automatically

#

A sprite atlas is not really intended to fix this specific problem either, but incidentally helps
And it's not as complex as pixel perfect rendering

modest cargo
#

The sprite editor cannot do it

#

You need to modify the image itself in an external image editor, then slice it again in sprite editor

novel timber
#

i thought you meant sprite editor as image editor

#

what do you mean by external image editor?

#

Inspector?

#

Its my first time working with 2d in unity

modest cargo
#

I mean not Unity at all, but an image editor like Gimp or Photoshop
Aseprite can do the operation automatically very easily but it's not free

novel timber
#

damn

thorn star
#

orthographic camera strikes again, with a very large difference between scene view and game view... The shader i am using is one that allows me to have animated sprites, i would reckon that this is not the issue, due to the fact this issue does not occur on other animated sprites with the same shader. The skybox background is definitely black btw. It almost seems like the orthographic camera is not clearing the pixels, or something odd like that... Are there any workarounds?

#

ah discord compression has kinda ruined those screenshots.... the pink lines are much more visible than discord shows

lean estuary
#

Pretty weird issue. Have to narrow down the problem if it's a shader, or rendering pipeline maybe.

thorn star
lean estuary
#

Narrow down by swapping shader, assets shader is using. If it happens in a specific configuration

thorn star
#

doubt it is the shader though, or else changing mesh wouldn't affect it, atleast as far as i know

lean estuary
#

Maybe something off in that shader. Try leaving in only necessary parts to test it, no animation and swap manually to test

#

only minimal nodes

thorn star
lean estuary
#

just leave the sprite swapping node and feed index values manually to it.

#

Just to strip down to very basics and remove all possible interference.

thorn star
#

Ok I've stripped it down to this and the issue still occurs, fascinating! Also upon unmaximising the shadergraph window i got this error.

lean estuary
#

Could possibly be a bug in Flipbook. What version Unity are you using?

thorn star
#

2022.2.5f1

thorn star
lean estuary
#

oh, does it happen if you use some base Unity sprites?

thorn star
lean estuary
#

or at least change the order of sprites

thorn star
thorn star
lean estuary
#

and using any unity sprite?

thorn star
lean estuary
#

UI stuff has plenty

thorn star
#

thanks ill check there then!

#

i remember there used to be a way to open up a window that would allow you to look through all textures in a project, unity and not unity, does this window still exist, is there a shortcut for it?

lean estuary
#

texture property on the material would open asset browser

thorn star
lean estuary
#

Target button on the right of it

#

Oh, just realized it's not going to work, it needs atlas

thorn star
lean estuary
#

Does your atlas asset uses any compression, filtering? Try turning that off, maybe bleeding in

#

An asset with several sprites

thorn star
lean estuary
#

Aren't you passing atlas to the flip book?

thorn star
# lean estuary and using any unity sprite?

ok turns out that it is really difficult to find a unity texture that would work to test this, as most are a solid colour throughout, and the ones that have different colours in each half usually have some sort of transparency around the edges...

thorn star
#

i dont pass any textures or anything to the flip book

#

i use the flipbook thing to sample the texture though

lean estuary
#

I mean yea, flipbook helps to walk through the atlas turning width and rows to simple indexes. I think.

#

So if you are not using an atlas you don't really need the flipbook

thorn star
#

i don't know if im using an atlas or not lol... I don't think i am, but i might be accidentally using one

lean estuary
#

I think I've linked this already. Here you can see how sprite atlas dimensions are being set and atlas itself. https://youtu.be/gEnsciDtbUQ?t=132

I go over how to use Unity's Flipbook in the HDR Shader Graph. This will show you how to use your own sprite sheets to make animated textures for your own projects. You can use these steps to improve on the methods shown as I go over some of the basics.

No coding was used in the making of this video. I show how to animate the tile amount throu...

▶ Play video
thorn star
#

ok and ye I can't work out if this is affecting unity sprites or not

lean estuary
#

If you are not using atlas and just entering sprites that would cause anomalies

thorn star
lean estuary
#

So either put them into atlas or just swap sprites without flipbook manually,

thorn star
lean estuary
#

With flipbook you can create animation timer inside the shader and expose some controls. With regular shader you would animate like you previously did with coroutine.

thorn star
#

I'll do it the flipbook route then

#

how would i create an atlas?

lean estuary
#

in any image editor put then on a grid

thorn star
thorn star
lean estuary
#

Make sure that atlas dimensions are setup correctly as well

#

width and height on flipbook

thorn star
#

yup, 2 width, 1 height is correct

lean estuary
#

Also no compression or filtering, it may have been bleeding in. On the atlas asset

thorn star
lean estuary
#

It should have sprite mode multiple I think

thorn star
thorn star
lean estuary
#

then maybe leave it alone for now and do it with coroutine. You can detail the problem and post it on the forum, might get solved there.

thorn star
lean estuary
#

!forum

#

!forums

barren orbitBOT
#

💬 Have a question that requires a more detailed explanation? We suggest using the Unity forums https://forum.unity.com/ to ensure your question is answered more effectively.

thorn star
#

thanks a ton!

sudden ore
#

!Bearn

#

!learn

barren orbitBOT
#

🧑‍🏫 Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

wary plover
#

Hello guys i am very new to unity and i wanted to ask how to check if a game object left the camera in a 2d game i tried googling it but i didnt find anything that worked for me can someone tell me how
?

orchid thicket
#

Also, i need some help, i need help creating an animation from the PNG frames. I drag all the frames, but it keeps flashing, and its not really smooth

tall current
#

Heyo, I'm trying out the 2D shadows with 2D-URP.
When the light I'm controlling with the point goes too far away from the object being lit in the scene, the object ignores all other lights too.
There shouldn't be anything different from the light I can control compared to the non-moving ones.
Is this some shadow-option I'm missing?

upbeat edge
#

When you're importing sprites, is there some way to make them full squares when using a tilemap instead of using their custom physics shape? Here's my settings, which I had wrongly assumed were doing what I wanted 😦

(Mesh type being full rect and generation of physics shapes disabled)

solemn latch
upbeat edge
#

This is getting pretty annoying -- I can't view my rule tile in the tile palette, because I'm only using the gameobject property. If I do use the sprite property, the sprite doesn't disappear when the gameobject is removed in the game..

#

Is there some way around this? I am sick of losing track of it, and I'd rather not make a "YOUR RULE TILE IS RIGHT HERE" sprite in my tilemap, haha

upbeat edge
#

At the moment I am thinking that each tile needs a reference to the tilemap it's on, and then deletes the tile in its cell when it is destroyed

woven quest
#

Hi all! Can I ask for some help please 😅 When import a PSB into Unity. I have layers for each sprite frame. But Unity cuts away the empty space around my layers. How can I force Unity to use the entire layer instead of cutting out the sprite?....On the left is the photoshop layer, on the right is the cut out sprite in Unity.......Why this is a problem is because the pivot is now off, so the sprite is "jumping" around in the animation.

uncut forge
woven quest
#

I know but I don't want to manually fix all the pivots, that's going to take a long time to get right

elfin sandal
#

have you tried import mode: merged

#

or activate/deactivate automatic reslice in import settings

woven quest
# elfin sandal have you tried import mode: merged

Hi! Thanks for the ideas! 😁 The automatic reslice doesn't seem to do anything. The merge one actually works to keep the spacing, but it throws all my layers on top of each other. So that's not going to work either.

elfin sandal
#

Oof srry to hear that
I do recall flipbook animation being used with psb importer in a unity video tho
I forgot the timestamp but it was aunity presentation of the animation package

woven quest
#

If you're talking about this one. It's hard to see if his scene has the same problem. He doesn't mention or explain an option for it at all. Which makes me feel his scene has the same issue. Scratch that, his scene does actually have the same problem. You can see the bottom shadow of the butterfly hopping up and down.

#

Another comment proving the same problem.

#

Is there an official Unity person we could tag in this problem? Seems like a real issue.

elfin sandal
#

Best place to do it would be forums

woven quest
#

You mean here?

elfin sandal
#

Thats unity answers
Forums is seperate
Theres a 2d dedicated section in the foums with a pinned thread about 2d features that the 2d devs are part of and check regularly

woven quest
#

Awesome I did this, thanks!

plush prairie
#

Hi, I created a tile and imported into unity and the colours are a bit off

Image 1 is what it looks like in Aseprite and how it should look
Image 2 is what it looks like in Unity

#

is anyone able to help pls?

modest cargo
plush prairie
#

perfect, thanking you! 🙂

modest cargo
#

@spring crypt More of a #🖼️┃2d-tools question, the two main ways are to have a stack of multiple ortho cameras of different sizes for each layer, or to average an object's transform position with its start point and the camera's position to some proportion
A an object that inherits 100% of camera's position is virtually at infinite distance
at 0% it's in the foreground, 50% somewhere in between and at negative values it seems to pop out from the scene towards the camera

spring crypt
#

I see. That makes sense, thank you.

#

Another question I have that is bugging me, if you don't mind answering, is why is this character unable to render on top of everything else? I have tried literally everything but it just won't work lmao. Tried sorting layers, messing with the game objects z position, nothing works

modest cargo
spring crypt
#

And the final one is, I don't quite understand the interaction between a canvas and a 2D camera here. Why is this camera white square space so small compared to the canvas? Should the camera adapt to the size of the canvas or is it the other way around where the canvas should adapt to the camera? I have a canvas here that is holding 2 background images with these settings (So that the images that are supposed to be parallaxed fit to the player's screen aspect ratio and resolution at all times)

spring crypt
modest cargo
#

Canvas treats scene units as pixels, other gameobjects treat them as meters

spring crypt
modest cargo
#

So what you want to do here is bring your character back into the view of the camera, and make it reasonably small again instead of hundreds of meters tall

spring crypt
#

Ahh, that makes sense.

modest cargo
#

I like to hide the canvas from the scene view using this eye icon next to the Canvas object when not editing it because it tends to get in the way
You should normally use the canvas only for UI and stuff that needs to be rendered on top

spring crypt
#

Could you help me understand why is it that the camera here when in the scene shows blue empty space as if it is looking at nothing at all, but when I switch into game view, it shows me the correct BG images?

spring crypt
modest cargo
modest cargo
# spring crypt Oh i see, that makes sense. Thank you! So whenever I want to place these backgro...

Generally yes
You absolutely can use canvas for background images, but the canvas needs to be in screen space - camera or world space mode, which changes quite a bit how it works
Canvas is meant for elements that adjust to changing screen size and aspect ratio, which is an useful feature but you can also get tangled up in those systems and end up with stretchy city backgrounds unless you know how to work with it

spring crypt
# modest cargo Generally yes You absolutely can use canvas for background images, but the canva...

Yeah, that is exactly what I wanted to avoid to happen about having stretchy images. I want the images to adapt to the player's screen aspect ratio so lets say someone is running the game in an uncommon resolution/aspect ratio of idk 800 x 750 or something like that or on a wide screen monitor, so I'm trying to understand how the canvas works. but you helped me a lot already! Thank you ❤️

modest cargo
#

I have this old demo about the kind of parallax systems we talked about initially
Not super elegant but may be useful
Let me know if it's broken or something

spring crypt
#

Alrighty <3. Just to make sure, this is what you meant before right, so now my canvas has my main camera set as the render camera and the canvas adjusts to the camera. But the character remains not being able to render on top of it

spring crypt
modest cargo
#

Images and sprites use different sorting methods

#

In fact try to work without a canvas at all for now is what I'd suggest
Only add it in when you need icons for lives or score or such

spring crypt
#

Alright. Will do that, ty

spring crypt
#

Can anyone help me out here? I wanted to know why is it that when I press play on the game the camera is actually showing stuff that it should not be showing. I thought the only visible things whenever I pressed play would be the stuff inside the white camera square on the scene.

Why is it showing the bottom part on the game scene? 🤔

elfin sandal
#

is it a perspective camera

spring crypt
#

Settings on it:

#

The camera is basically also attached to the character

solemn latch
spring crypt
#

Hmmm

#

Ill post this under code help

solemn latch
#

I mean, that's a very basic script but it isn't broken. It is doing exactly what it is supposed to do.

modest cargo
# spring crypt

Maybe you'd want to use transform.position.y instead of target so it won't follow on up/down axis

solemn latch
#
using UnityEngine;
using System.Collections;

public class SmoothFollow : MonoBehaviour {

    public Camera cam;
    public Transform[] targets;
    public int targetIndex = 0;
    public float height = 5.0f;
    public float heightDamping = 2.0f;
    public float horizontalDamping = .5f;
    public float zoom = 10f;
    public float zoomSpeed = 4f;




    void Start()
    {
        if(cam == null){
            cam = gameObject.GetComponent<Camera>();
        }

    }


    void LateUpdate () {
        if (targets[0]==null) return;

        float wantedXpos = targets[targetIndex].position.x;
        float wantedHeight = targets[targetIndex].position.y + height;

        float currentXpos = transform.position.x;
        float currentHeight = transform.position.y;

        currentXpos = Mathf.Lerp(currentXpos, wantedXpos, horizontalDamping * Time.deltaTime);
        currentHeight = Mathf.Lerp(currentHeight, wantedHeight, heightDamping * Time.deltaTime);

        transform.position = new Vector3(currentXpos,currentHeight,transform.position.z);


        if(cam){cam.orthographicSize = Mathf.Lerp(cam.orthographicSize, zoom, zoomSpeed * Time.deltaTime);}

    }
}```
#

Or just use cinemachine 😄

spring crypt
solemn latch
#

That's the camera script from my first game and it can handle a lot

spring crypt
#

There is just too much stuff, haahaha. Is there some list around here with like "must have plugins" to just make life easier on usual game dev tasks?

solemn latch
#

I think cinemachine is absolute overkill for most 2d games.

#

The main reason to use cinemachine would be if you need the collisions and stuff it can handle.

modest cargo
#

Mesh confiners and blends are quite nice
I agree though most of its features are designed specifically for 3D cameras

solemn latch
#

Well, my script handles blends pretty nicely 😄

modest cargo
# solemn latch Well, my script handles blends pretty nicely 😄

It handles one type of blend, Cinemachine is great if you need more
Personally I'm not a big fan of the "accumulative" use of lerping, but I don't think it causes many problems
The main concern is that exponentially slowing camera motion can cause shimmer or jitter with pixel graphics

thorn star
solemn latch
thorn star
solemn latch
#

Especially if you aren't replying to a thread a dev is already watching.

thorn star
solemn latch
#

Forum topics.

thorn star
solemn latch
#

Link your forum post?

solemn latch
#

Yeah, something fucky is going on there.

#

Is your camera facing the right direction?

thorn star
#

pretty sure it is

solemn latch
#

Did you try turning off the rest of the crap in the scene? The rest of the 4.3k triangles the inspector says are in your scene?

thorn star
#

2.2k triangles is the lowest i can go, with prefabs taking up most of them

#

with generation distance of 1 (1 block in all directions from the player), the pink lines still appear on those few generated blocks, odd

solemn latch
#

Why do uou need ANYTHING in the scene?

#

Aside from the thing you're testing.

thorn star
#

true, but it would be a real pain to have to bring the stuff back afterwards

#

i can't just create a new scene with only those weird blocks, cause I'm using ecs, and i have a ton of systems which are looking for things to be in the scene, and if they don't find it, they throw a whole bunch of errors

#

i suppose this could be an issue with however ecs does rendering? Then again this could be an issue with almost anything, and it is a bit of a nightmare to try narrow it down...

solemn latch
#

Make a new scene

#

Bring in the trouble object

thorn star
solemn latch
#

See, this is all stuff you didn't list in your post and any of these things could be contributing to the problem.

thorn star
#

wait im an idiot, shaders render in editor mode, so i dont need to do this in playmode, hold on while i try this!

thorn star
thorn star
#

ok from lining up the scene camera as close to perfectly as i can, I can sort of see the pink lines in scene view!

#

looks like this oddness is near pixel perfect

solemn latch
#

I don't see how this is even a #🖼️┃2d-tools question, so no wonder nobody there is answering

thorn star
solemn latch
#

You also haven't even said what render pipeline you're using

thorn star
#

scared to move channels though, cause i dont want the mods to get angry

thorn star
solemn latch
#

I think that what you really need to do is try to figure out, if not what is causing it, at least what the problem actually is.

solemn latch
#

And then you'll be able to write out a question that peeps can potentially help solve

#

Well, first of all try and actually describe your scene and what is going on in it, since I still have no idea.

#

Try the shader in a fresh project

#

Debug your meshes

thorn star
thorn star
thorn star
solemn latch
#

That really just sounds like you need padding in your UVs.

#

If that's all

thorn star
#

what are UVs?

solemn latch
#

...yeeeah, I think I am seeing the potential problem here

thorn star
#

this is my first time doing a 2d game, I currently don't know much about shader lingo, sorry lol

solemn latch
#

UVs are the texture coordinates of the mesh.