Questions tagged [sprites]
A 2D rendering of an object in space. Sprites are two-dimensional bitmaps that represent objects or entities in a game and populate larger scenes.
1,113
questions
0
votes
0
answers
39
views
Downscaling from 1080 to 768 in Unity 2D
I have an orthographic camera of size = 10.8 and I use it as base and have developed the game for a 1080 display. On a ...
0
votes
1
answer
29
views
Detecting whether sprite is outside the camera's view
I want to detect when the game object is not visible anymore.
I search for the size of the SpriteRenderer, and convert it to screen space. Then, I check if the ...
2
votes
1
answer
162
views
How do I implement HP bar using OpenGL?
I got simple hp bar container from open game art, rendered the texture and now I am wondering how to fill it and change the amount of filling.
I decided to render red rectangle over the container and ...
0
votes
0
answers
32
views
Use Universal-LPC-Spritesheet-Character-Generator in Android game
I am writing an Android game. I wonder if there is a possibility to use this sprite generator https://sanderfrenken.github.io/Universal-LPC-Spritesheet-Character-Generator/#?body=Body_color_light&...
0
votes
1
answer
50
views
Why do my svg sprites (vector images) appear to have very low resolution in the game view and how can I fix this issue?
I recently drew a game sprite for my game using Adobe Illustrator 2021. I exported the sprite using the Export for Screens menu to export the entire artboard. The problem I have in Unity 2021+ is that ...
0
votes
1
answer
61
views
Should a swinging sword be part of the player sprite, or its own separate sprite?
Should the sword be part of the player sprite and therefore share the same hitbox that is widened when attacking?
or
Should the attack animation be separate from the player sprite therefore having its ...
0
votes
1
answer
31
views
Color mismatch between transparent asset from Photoshop and Unity in 3D project
I have created a simple asset in photoshop (teal square) with transparency. To make the square semi-transparent, I just changed the layer opacity from 100% --> 50%, then exported the file as a .png....
0
votes
1
answer
72
views
Can I use normal images to make tiles in Unity?
If I'm not wrong, those are steps to use tiles with Tilemap in Unity
Upload sprites to Unity
Create a palette.
Upload sprites to the palette to create tiles.
I need some static images to use with ...
1
vote
1
answer
42
views
Sprite with hard transition from opaque to transparent shows translucent pixels in Sprite Editor
I have no idea why I have blurry/transparent borders on sprites when I cut them in the Sprite Editor, whereas I get everything fine in a graphic editor.
Picture from Sprite Editor with a problem:
...
0
votes
1
answer
39
views
How does Sorting Layer work *under the hood*?
I know how to use SpriteRendere's Sorting Layer and Order in Layer. But how do they actually work under the hood? How the render ...
0
votes
0
answers
25
views
Custom Idle Animation not working
I'm trying to insert the idle animation in the if-else statement but whenever I run the game, it doesn't play the idle animation, just the running animation. The base of this algorithm is from the ...
0
votes
1
answer
98
views
Sprite renderer doesn't update color in realtime
Whenever I add colors in Unity using script it updates it in the sprite renderer but I don't see the result on screen and it's not the alpha issue. I can see the result in the sprite renderer color ...
1
vote
1
answer
80
views
Should I destroy dynamically created Image.sprite?
Image sprite is created programmatically
_image.sprite = Sprite.Create(texture, ...);
Should I destroy it before replacing with a new one?
P.S.
My question comes ...
0
votes
0
answers
44
views
2D Runtime animation with different textures
We have a bunch of characters in our game. Although they look the same mainly, they do have differences. We are downloading the textures on runtime, generating an atlas that decreases the draw call, ...
0
votes
1
answer
32
views
Rotate and Zoom a group of tiles
I'm working on a tile-based game and I'm trying to rotate my tiles as a group around the center of the screen and want to have the ability to zoom in and out. Here my code:
...
0
votes
0
answers
36
views
Show CIV icon in popup in Civilization 5
I'm modding Civilization 5 to add a popup into toppanel.lua with all information about each player. I show the name of the player and their total gold, science, ...
0
votes
0
answers
43
views
How can I change the texture of a prefab clone when it's clicked?
I have a prefab (called ArableLand), and when I click on the ground in the play mode, the ArableLand prefab instantiates a clone of itself.
For example, if I click 3 times on 3 different places, then ...
0
votes
1
answer
97
views
How to change sprites for multiple child object from a parent?
I am not much of an expert, tried to look up for solutions but I never found any that I could use.
I have a parent object, and I want to change it's child objects randomly. This is the hierarcy:
I ...
0
votes
2
answers
206
views
Sprite Shape & URP Custom 2D Lighting Shader
I've been losing my mind over this for a couple of days now, and can't find any concrete information about it.
I am trying to write a custom shader (shader graph to be specific) to light sprite shape ...
0
votes
1
answer
63
views
Clip a 2D sprite within a bounding box without masking
In Unity, working on a 2D game, I have a platform game where the platforms can "sink" when jumped on. The platforms are 32x32 sprites, and when sinking, the desired effect is to push the ...
0
votes
0
answers
55
views
Workflow For Manually Creating .DDS MipMaps For Unity?
I am hoping to gain some clarity on the proper way to create .DDS format mipmaps for Unity. I was able to create the file and successfully import it into Unity, but I am certain my workflow is far ...
1
vote
1
answer
99
views
How To Calculate The Correct Sprite Dimensions?
I am creating a 2.5D game similar to Paper Mario. I want the sprites that I import to Unity to be the perfect dimensions so that quality is not affected by the camera's position. If I'm understanding ...
0
votes
1
answer
322
views
Sprite becomes blurry or jagged when camera zooms out
My game uses 2D sprites in a 3D environment, and I'm really struggling with my sprites' quality.
I have high resolution vector art with clean linework created for my sprite. I'm exporting it as a .PNG ...
0
votes
1
answer
73
views
How to show orientation on an image minimap in Unity
Initial Question:
I'm trying to create a minimap for my game in Unity. It consists of a 2D image sprite within a mask. I've got the rotation and the movement within the mask down, but the only problem ...
1
vote
1
answer
107
views
Raycasting : computing x position of sprite on the screen
I am trying to create a raycasting engine using C and CSFML, I already have the walls and textures rendering done and right now I would like to be able to render sprites into the scene.
The difficulty ...
0
votes
1
answer
340
views
How to achieve 2.5D billboard sprite effect? (Don't Starve-like)
I'm trying to re-create the same effect of sprites/billboards that all entities in a game such as Don't Starve have.
What is the best way of doing this in Unity? Certain things come to mind:
Have a ...
16
votes
1
answer
5k
views
Blank 2.2 KB sized PNG costs 2.1 MB in Unity? What does this represent? What to do?
I am starting to work on optimization for my app. I need to understand the information Unity displays about file sizes. For example, just to prove a point, here is a 2.2 KB completely blank PNG which ...
0
votes
0
answers
69
views
Copy sprite with different geometry in Runtime
I've got some isometric 32x16 tiles
...which I divide into four pieces, for instance the top left 16x8 piece:
What I'm trying to achieve, is from this corner which is a Sprite object, to generate a ...
0
votes
2
answers
253
views
Flipping a sprite with SpriteRenderer.flipx when the pivot is not centered
My sprite has a pivot in the bottom left so that it snaps on the grid. Flipping the sprite with flipX almost works, but the sprite also shifts one quare to the left/right when flipping.
Gif of ...
0
votes
0
answers
65
views
SpriteRenderer shows stripe artifacts in build
The sprite renderer can render the sprite correctly in the Unity Play mode, but when I build the game, it can't render the sprite correctly, and there are stripes on the sprite.
Here are the ...
0
votes
1
answer
48
views
Create list of images for animation
I'm using pygame and trying to create an animation by going through a list of variables:
self.image = self.walk_right[self.index]
I have loaded the images into ...
0
votes
0
answers
32
views
How do I make it look like the ring here is going around the spire?
I have game objects which I'm placing relative to a tilemap using the GameObject brush from the 2D Tilemap Extras package.
Unfortunately, I'm not sure what is necessary to acheive the visual look I'm ...
0
votes
1
answer
205
views
How to Force Refresh Texture2D/Sprite when Programmically Modified using Editor Script?
Here is some code called using a custom button in the component inspector:
...
2
votes
1
answer
210
views
How to animate a 2D top-down fish?
Recently I've been trying to create a controllable fish character. The game is 2D and top-down.
My two approaches are:
Skeletal Animation, which is versatile but looks too robotic. For example, no ...
2
votes
2
answers
50
views
Animating a line around an image for Unity app
I would like to animate a line around an image, starting from the top right going clockwise around the image and then show the check mark.
The animation should be possibel to stop and restart.
There ...
0
votes
0
answers
30
views
I am trying to make a multiplayer game, and my 2d sprite shows up when I click play normally, but not when I press build and run?
When I press the play button at the top of the screen, I can see my sprite, but not when I press build and run.
Why is this?
(enter image description here
1
vote
1
answer
381
views
Trying to get sprite from isometric "z as y" tilemap
I'm using code like the following with a tilemap and tilemap collider 2d:
var ray = Physics2D.RaycastAll(worldCoordinate, Vector2.zero);
Unfortunately, when I ...
0
votes
1
answer
388
views
Simulating sprite shadows for a 2D top-down game
I have read some other posts with almost identical titles on here, but they are not exactly what I am looking for. (What I have seen come up a lot in 2D shadows is some sort of "ray-cast effect&...
0
votes
2
answers
139
views
Draw 2D circles/squares efficiently with Unity
I'm doing a lot of 2D simulations using Unity, and I usually instantiate a lot of squares/circles sprite. When the number of sprites reaches 1k or higher, the FPS usually reduces to 10-20, which makes ...
0
votes
2
answers
586
views
How do I make several Image components transparent collectively as one sprite with a CanvasGroup?
I've run into a problem where using the CanvasGroup component to fade in/out several Image components under a hierarchy produces an unwanted result, where each individual sprite that overlaps with ...
0
votes
1
answer
112
views
Changing part of a sprite in 2D game
Let's say I have a character and certain things (shoes, vest, hat, etc.) can be changed (visually, just the color changes).
What came to my mind was creating each of them as a separate sprite and then ...
2
votes
1
answer
87
views
How are map/room/world-related game assets usually organised and implemented?
I'm trying to build a simple 2D Shoot 'Em Up type of game in C++ using SDL2 and an Entity Component System, which I've already implemented. The idea is to have different maps/rooms where you have to ...
2
votes
0
answers
173
views
Unity 2D Sprite Cutout with border
I'm working on a 2D simulation game and have one object floating on top of another one. I have a Sprite Mask on the object on top to achieve cutout like effect so the background is visible where the ...
0
votes
1
answer
97
views
weird blurring of tiles in unity2d tilemap
My tiles don't have any anti-aliasing because I am going for a pixelated look. But when I add my tiles to a tile map it automatically puts anti-aliasing on them. My tiles look like this:
when they ...
5
votes
2
answers
1k
views
RPG - How to deal with the collision of a sprite with a side-view thinner than its front-view?
I am currently working on a role-playing video game featuring sprites that take the form of antropomorphic objects. These sprites can move around in the four cardinal directions, and turn to face the ...
0
votes
0
answers
67
views
How to make a png or Paper 2D blueprint character move 3 dimensionally from location to location?
I have already turned the png files into blueprint class Paper 2D sprite thingies, but when I make it do an AI move blueprint it won't follow any of it and will stay still no matter what. I also ...
0
votes
0
answers
20
views
simple button color change
Hello i want to create a simple button that activates on a click but my code wont activate and I've tried an print plus a color change of the sprite but none of these worked, the button is a image ...
0
votes
1
answer
359
views
How to rotate parent and all children by center pivot?
I have a DoorSprite with an Animator component which I animate by rotating it by 90 degrees (makes the door look like opening ...
0
votes
0
answers
132
views
LibGDX sprite not moving with rotation
I have a player class and I'm trying to rotate the player and move it in the direction it's facing. The rotation works but I can't get the sprite to move.
...
0
votes
1
answer
66
views
BoxCollider2D used as reference to Collide with GameObjects but it uses the original size Sprites size to Collide
I'm a beginner in Unity and pretty much copy and pasted the code but I can't figure out why the game is using the size of the sprite and not my BoxCollider2D as a ...