Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 talibob · Aug 01, 2011 at 10:31 PM · instantiatecubeminecraft

Place cubes? problem with my script :S

Hey guys! :) Im still making on my minecraft likely game. Im trying to make a system to i can place cubes. Like this video shows: http://www.youtube.com/watch?v=mOEUkdob5bQ

I just cant figure out how to make a script witch is placing these blocks right :S

at the moment i got this

 var Cube : Transform;
 
 function OnMouseOver() {
 
 renderer.material.color = Color.gray;
 
 if (Input.GetButtonDown("Fire1")) {
 
 
 Instantiate(Cube, GameObject.Find ("spawn6").transform.position, transform.rotation);
 
 }
 
 }

I made my blocks in 6 parts 1 cube on each side. all these cubes got this script. I made a little spawn cube where they could spawn but its not going great :S. hope you can help me :)

Comment
Add comment · Show 2
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 vxssmatty · Aug 01, 2011 at 11:47 PM 0
Share

$$anonymous$$inecraft and $$anonymous$$inecraft style games dont used blocks to create the world, it is a single mesh that is generated via script and modified by the player.

There is a good thread with examples located here;

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

avatar image testure · Aug 01, 2011 at 11:52 PM 0
Share

this is a bit off topic- but what is with the sudden rash of $$anonymous$$ecraft clones? why are people so hellbent on copying it? it's not like they can make a $$anonymous$$ecraft clone and suddenly make as much money as notch has made... there's such a thing as 'market saturation' you know :P

Also- on topic: if you simply make a bunch of cubes, you're going to run into performance issues extremely quickly. you would need to generate a mesh by specifying where the vertices should be. It's essentially a giant CSG boolean operation that has very efficient octree culling and optimization.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by DayyanSisson · Aug 02, 2011 at 03:41 AM

I don't know if this will help you but this a basic instantiating script

 var newObject : Transform;
 
 function Update () { 
     if (Input.GetButtonDown("Fire1")) {
         Instantiate(newObject, transform.position, transform.rotation);
     }
 }
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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Creating blocks script! Need help :) 1 Answer

Instantiate 697283 trees by script? Crash! 2 Answers

Scripts not on instantiated GameObjects? 1 Answer

Instantiating Cube Prefabs with scale 3 Answers

Is it possible to load a script to a gameobject, run it then destory it? (Onetime script) 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