Комментарии:
Question
When would you use a MeshRenderer instead of a SpriteRenderer?
Possible Answer
By using a MeshFilter and MeshRenderer you can do some really cool things with the mesh, you could still use a quad and dynamically move the vectors to create a wobbly effect or use a Texture2D instead of a Sprite and do some spritesheet animation by modifying the UV array.
My animation system works with Meshes instead of the SpriteRenderer so that I can dynamically create a mesh that contains a quad for each body part, that way the game only uses one game object to display multiple body parts that are animated.
Thank you so much for this tutorial. This did wonders for a VN style game as well. Having backgrounds swap in and out is so much easier to call outside of script than anything else I've tried, and I've tried a LOT(previously I had gameobject as parents for each sprite and SetActive for each one, then worried about how I was going to disable them when I switched locations. Absolutely awful stuff.) So I truly appreciate this!
ОтветитьComo se haría con objetos 3D
Ответитьhow would i get the sprites to continually randomly generate? i was able to do it with 3d spheres but losing the little hair i have trying to get the sprites to do it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OmiSpawn : MonoBehaviour
{
public Sprite OmiSprite;
public float Speed;
public GameObject Omi;
void Start()
{
SpriteRenderer spriteRender = gameObject.GetComponent<SpriteRenderer>();
GameObject OmiGameObject = new GameObject("OmiGameObject", typeof(SpriteRenderer));
SpriteRenderer OmiSpriteRenderer = OmiGameObject.GetComponent<SpriteRenderer>();
OmiSpriteRenderer.sprite = OmiSprite;
InvokeRepeating("Generate", 0, Speed);
}
void Generate()
{
int x = Random.Range(0, Camera.main.pixelWidth);
int y = Random.Range(0, Camera.main.pixelHeight);
Vector3 Target = Camera.main.ScreenToWorldPoint(new Vector3(x, y, 0));
Target.z = 0;
Instantiate(OmiSprite, Target, Quaternion.identity);
}
What if I want my burger to have different tints?
Like one have a red bun and purple cheese while the other has an orange bun and green cheese.
Would I need to have the parts of the burger as different sprites, or could I have one sprite with different tints?
Q1. how to scale a gameobject with spriterenderer component inside another gameobject.
>When I try scaling with Recttransform component, it doesnt work. If I change the scale values, it works but the bounding box increases too causing it to have bigger size than the parent gameobject
>When I try scaling using Transform component, I can resize it manully to fit the parent gameobject but cant really make it accurete like what RectTransform can do using the anchor presets
How to correct error (Sprite Renderer does not contain a definition for 'IsUsingDeforableBuffer' and no accessible extension method 'IsUsingDeformableBuffer'accepting a first argument of type 'Sprite Rnderer'......
ОтветитьHow can I change the color or sprite from a different object in the scene? Also great tutorial.
Ответитьbro i want to change multiple sprites , can i use a sprite[ ] array or is there another way to change multiple sprites to one object?
Ответитьthe idea to make a video about sprite renderer is great,
but sprites examples are crap. People just wouldn't get what slice is for and why your pixelart ship looks blurry
Very professional tutor 👏👏👏👏 I watched several tutors but you seem to be advanced so far.
Ответитьand i quote "our spaceship has now converted into a burger through code" coding truly is boundless
ОтветитьI want to code a battle box in the game Undertale but I don't like how when the box resizes, the walls stretch as well.
Is there any way to fix this?
For some context, I have all four walls as Separate GameObjects and, all of the walls have the same parent object.
If you use a bone type Sprite and we want to insert it in our Sprite renderer how are we going to do that
ОтветитьSo I get a character from the asset store, and I also got an animation, how can I combine them together to make a simple character movement animation [3d game]
ОтветитьNow I know how to convert a spaceship to a burger
ОтветитьHow can I get this 1x1 sprite. I only have this other options.
ОтветитьDude, thanks.. omg how i can thanks u!!!!!!!!!!
u solved my problem cuz i am a beginner.
tnx tnx tnx tnx tnx
i have a scroll view (1 X unlimited) , think ribbon, need to change the contents, 50 items, 10 item, ect... i have the different lists in a folder, so the code is the same for all, point to folder, for each sprite renderer, change the sprite, until no more sprites are left in the folder. what have i forgetten?
ОтветитьI create the sprite and i can see it in the scene window but when i switch over to the game tab i do not see it at all even though it is in my camera
ОтветитьHello Monkey, I have a question. How can i disable sprite fully, like not in sprite renderer but to uncheck the checkbox which is above the "Transform" component and "Tag"
UPD: ohh, i got it
For everyone: you need to create a public GameObject in your script than put GameObject here and SetActive(false) to this GameObject
btw, ty for lessons, Monkey <3
Great intro to SpriteRenderer! Thank you :)
ОтветитьI can't see my sprite!!!
ОтветитьWhat program do you use for making sprites
Ответитьi rate this 3 kohlrabis out of 5 cauliflowers
ОтветитьWhen I had finished slicing my sprite and hit apply, it still displayed the full sprite. Did I do something wrong? I set my sprite mode to single and mesh type to full rect. The warning under the draw mode in the sprite renderer was also disappeared
ОтветитьMonkey code do know how to make sheder codes ?
The reasons I don't make sheder graph from is because I need urp and the urp don't support multiple cameras and my game have split screen I don't want see eny thing pink
If fixed that problem I use urp from the sheder graph only
A highly underrated channel. I can see it blowing up soon.
Ответитьwhy do you use the letter "f" when referring to coordinates or values?
Ответитьanyone offer help? when i make png sprites from vectors and place them close to the front of the camera in my 2d unity document, the edges appear soft and blurry. anyone know how to keep them crisp?
ОтветитьHi, you advertise you Utils library in your videos- it looks interesting - but downloading it requires registration - are there any strings attached?
Like other than you keep log of who has downloaded it. I'm Asking since your create account doesn't tell anything...
Why when i put an sprite in my game and scale it down it will be like pixels?
ОтветитьCan you make a tutorial about the 2D srpg(tactics) game?
ОтветитьI know how you did intro for games
ОтветитьHow to render an image from disk (by path), which is not added to project?
ОтветитьHey code monkey! I really like your work but you got me curious about your utilities package you were talking about. I went ahead and signed in to download it and try it out, but the confirmation email is not comming to me. :( I've tried on 2 email service providers, checked spam and other folders. still nothing, after a few days (I've done it on 20.08 if I remember corectly). Could you check it out? That would be awesome! Thanks in advance and keep up with your good work!
Ответитьyou chanel is super cool
Ответить