#how do i apply 2d materials to objects
1 messages · Page 1 of 1 (latest)
What are you trying to do actually
You're mixing up a lot of terminology and I'm not sure what the goal is
put this on a object
I don't know for sure what that is, nor what your object is
its a 2d square
3D meshes, 2D sprites and terrains all work with different rules
Is your gameobject using a mesh renderer, sprite renderer or a terrain component?
sprite rend
Sprite renderers should use the Sprites-Default material
To assign a new sprite you set the Sprite field to a texture that's of the type "Sprite (2D and UI)"
why would you?
If you're working in 2D, you normally use the Sprite Renderer with the Sprites-Default material
ok
Note that there is no "Unity 2D" or "Unity 3D", you can mix and match both types of renderers in a scene, but they're used in different ways
so how would i add a custom material
To accomplish what?
to make a 2d floor that looks like this
You would make a sprite out of it
Not a material
Sprites don't support 3D lighting or normal mapping though, so you might want to use a 3D material on a quad mesh instead (in case that is your actual goal)
Hard to say, you're not really giving any specific info at all
trying to make a game that is in the top pov, so the floor would be covering the entire screen
so what im trying to do is to make a object that has this material
this is the package:
Does it need to respond to lighting?
you mean having shadows and stuff?
Yes, the material you're trying to implement uses normal mapping so I assume this is important for you
yes then
To make it look like exactly this, you only need the color texture on a sprite
To get normal mapped lighting like this, you shouldn't be using sprite renderers because they don't support it without custom systems
so how would i implemented the material
The 3D lighting one?
Just making absolutely sure because you replied to my post about the 2D sprite option
this
In that case find the texture asset with that color map, set its type to "Sprite (2D and UI)"
Now in project window you can "expand" the asset using the little rightward arrow to reveal the sprite asset inside
You can drag that sprite into the scene and it should set up a sprite renderer for it ready to go
The sprite asset should be revealable like this
In my example these are the import settings to make it a sprite
ok thx
problem is i cant resize it, im trying to make the floor really big so the player and move alot but if i make the sprite alot larger the material will increase in size as well
You can duplicate sprites and snap them end to end
Or even better look up how to use tilemaps
There's a bit of studying to do to get a handle of that system but it's well worth it