I am creating my first game on Unity, and I sliced a sprite sheet that I made. However, when I put the sliced sprites into my scene, both the scene and game view shows a white fuzzy outline.
I have looked online for help, but all of the articles I have looked at talk about Unity adds lots of anti-aliasing, which makes the sprite blurry. But my sprites aren't blurry.
Any tips would be helpful.
Thanks
Related
I'm creating a Chess game in Unity but I have ran into a problem.
I'm trying to render a Material behind the Chess piece, but instead its rendering In front of the piece.
The Problem
What I've tried
The Material used when I hover my Mouse
The Transparent Material below the Hover Material, when I hover
My URP settings
All the Chess Pieces are Sprites.
How can I get the Material to render behind the Chess Piece?
Please help I've been stuck wondering for a while now.
I'm expecting the Hover material below the Chess Piece, not above.
I have a WPF project that contains a 3D models. I did search a lot about Viewport3D but didn't found any helpful results to draw a barrel in 3D.
Also the Camera move is kinda bad, how can I edit it too?
Im developing a game like "bubble-bobble". So far I have done physics and collision detection.
Now I want to make my Hero (Rectangle Sprite) animated. I would be glad if someone could explain simple scripting for simple animated characters or some nice links for animation.
The XNA Documentation includes an entire article on Animating a Sprite. The basic technique is to use an AnimatedTexture class, which is included within the Animated sprite sample code.
The high level idea is that you load a texture into memory using a graphics API. Since you're using C#, this is most likely done through XNA.
This texture you have loaded contains each frame of animation that is required, and may span across multiple textures. When you go and render your 'sprite' object, you pass the XNA API the texture you want to use, and a source rectangle coordinates that surround the specific frame of animation you want within that texture.
It's up to you to manage this process. I create tools that assemble these source rectangles and stores meta data about each specific animation each sprite has; like which rectangles, and the duration of each frame, etc.
I've been making a 2D game with XNA that will have several unique enemies. I have no trouble drawing separate sprites to the screen, one over the other to make no two enemies alike, but I think it might be more efficient if instead of drawing a dozen sprites per enemy, I somehow merged those sprites into one sprite sheet.
If I have lots and lots of these enemies on the screen, will I improve performance by a worthy amount if I do merge? And is there a simple way for me to create new sprite sheets in this way, or is the answer quite fiddly?
It can be faster to draw one sprite instead of several. However, I would only recommend this, if you have performance problems. Drawing sprites is quite fast with the SpriteBatch. It has the nice feature to group draw calls of the same texture, which makes it pretty fast. If you create a separate texture for each enemy, you can loose this feature, which could result in a performance loss. Creating one large sprite sheet can be better, if the sheet does not get too large.
To create such a sheet, you have to create a texture / render target and render to it. Here is how to do it with XNA.
I have drawn tiles in my XNA game and loaded my character. My character, however, doesn't move- the map does, which gives it the illusion of movement. Now I am wondering how to actually test against them for collision. I mean, where does the collision code go and how do I make all tiles represent 'one big thing'?
There's a tutorial on pixel based collision detection on XNA Creator's club. You'll need to figure out what objects you want to do collision detection on. I guess you want the character to move across the tiled background, so you don't want to check for collision between your character and the background. Instead you should make any obstacle s sprites and do collision detection on those.
You might have a look at Nick Gravelyn's Tile Engine Tutorials, it goes through the whole process of creating a tile engine. There's a link here to see all the tutorials on YouTube.
You could have a look at the Platformer Starter Kit, it shows how to organize tiles in a map and check for collisions.
Rectangles have a intersects method. If your player is centered and you know the coordinates, loop through the other texture2ds and check for an intersection before scrolling the map.