Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Fanttum · May 17, 2014 at 11:43 PM · texturematerialminecraftblockswrap

How to texture blocks in a way similar to Minecraft?

So I'm new and really liking the engine. I'm currently just playing around with and trying new things. I'v been playing around making a map out of cubes for fun and it looks great but I want to find out how to texture them. I know about materials and how they basically work in unity but when I put a simple texture on a block I get the same thing on each side or reversed or otherwise.

My goal has to been to make the blocks sort of look like they do in minecraft. That being 4 of the 6 sides of the cube have the same part of the texture while the top (don't really care about the bottom) has a different part of the texture wrapped onto it. Such as a grass block I think?

Another way of asking this is if we think of a cube like a dice I want the top being side 1 to differ from sides 2-5. If a texture is a flat picture, how do I wrap it around my block in such a way that it covers it how I want it?

Any help would be great, in editor or scrips if I have to. I AM NOT MAKING MINECRAFT!!!! I am just using that as an example for how I want my blocks to look. No tile mapping or block behavior necessary. Thanks for hopefully understanding.

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Cherno · May 17, 2014 at 11:49 PM 1
Share

How are your cubes generated? How do you assign textures?

Answer these questions and also take a look at this thread:

http://forum.unity3d.com/threads/63149-After-playing-$$anonymous$$ecraft/page117

avatar image Fanttum · May 18, 2014 at 02:09 AM 1
Share

Yes I am using the primitive Cube game object and it sounds like UV mapping is what I was trying to figure out, I just didn't know the name of it. Will research more about UV mapping and try stuff out, just sounds more complex then I would have hoped. Any tips y'all wanna throw my way on how to easily UV map?

Also this isn't really a game yet, and its not $$anonymous$$e craft, just playing around with blocks on a map for now. I'd like to keep the number of cubes as low as possible, so I won't make a cube out of quads, but maybe I'll just put a quad on top with the texture I want there.

@getyour411 - I'd up vote you, but it won't let me :/ too much of a noob

avatar image Loius · May 18, 2014 at 06:03 AM 1
Share

What you actually want to do is click the check mark to mark an answer as 'correct'. This will do magical things.

avatar image Fanttum · May 18, 2014 at 07:12 PM 0
Share

@Louis what a magical thing!

avatar image Kiloblargh · May 18, 2014 at 07:16 PM 1
Share

If you are trying to do a voxel (cube-world) game, you must not use a 3d grid of primitive cube gameobjects. It's a waste of time even trying to do it that way- do more research to understand why and what the right way is.

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by getyour411 · May 17, 2014 at 11:53 PM

Google: UV map

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image torrente · May 22, 2014 at 02:06 AM 0
Share

Actually, I'd look at trying out Blender 3D. It's a free 3D application that runs on almost every platform. There are a few ways to generate a cube in Unity to do what you are looking for, but the effort will be wasted as it is much easier to make your models in a 3D application, UV map them there, and import them in to Unity (you'd be heading that direction anyway). I made the $$anonymous$$ecraft chicken for a student I was working with about a year ago, and now I can't help but add this pet to every character I make when running some tests!!!

avatar image
1

Answer by JasonBricco · May 18, 2014 at 12:05 AM

Basically you don't texture the whole cube, you texture each face that makes up the cube separately. If your cubes are primitive cube Game Objects, then I don't (think) you can do it this way although I'm not sure. I don't do mine that way.

But you could maybe make a cube out of primitive quad objects and texture each of those (and parent them together). You would want that whole cube being a single mesh, though. There are assets for this...

In a Minecraft-like game, you generate your faces procedurally and assign the texture procedurally. You have a big tile sheet with all your textures. You use UV mapping to select a section of that tile sheet to be put on a specific face.

There's kind of a lot to it, it's hard to answer without knowing exactly how you're making your game.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Cherno · May 22, 2014 at 03:15 AM

Here is a complete sample code for a Minecraft-like chunk mesh generation including adding and deleting blocks. I have used it as a base for my game myself and customized it to my own needs. It's easy to understand so I suggest you take a look. There are many other similar scripts around.

Dummycraft

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Simplest way to have a damage decal or texture on cubes. 0 Answers

How do I make this?? 1 Answer

texture.width not returning actual image pixels 2 Answers

texture alpha with color constant 2 Answers

how to ask a question regarding 3d models 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges