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 minecraftkingza · Aug 12, 2013 at 02:12 AM · collisionrandomplane

Overlapping Prefabs

i have a permanent terrain rendering set up, it randomizes the hills and stuff aswell but when the next "chunk" shall we say is rendered it will be fine until you walk to a new "chunk", at which point it will spawn a new "chunk" were a previous one would be, i have tried a few different ways to delete the newly rendered chunk if it overlaps an exsisting one.

 #pragma strict
 var terrainpplane:Transform;
 private var colliderr:boolean = false;
  var spawn:boolean = false;
  var boom:boolean = false;
 function Update () {
 var boxCollider = gameObject.GetComponent(BoxCollider);
 if (colliderr == false)
 do{
 boxCollider.size = Vector3(500, 30, 500);
 boxCollider.isTrigger = true;
 colliderr = true;
 }while(colliderr == false);}
 function OnTriggerEnter (other:Collider)
 {
 if (other.CompareTag ("Plane"))
 Destroy (gameObject);
 if (other.CompareTag ("Player"))
 {
 if (boom == false){
 do{
 yield(WaitForSeconds(5));
 var instancesnow1 = Instantiate(terrainpplane, Vector3(transform.position.x + 500, 0, transform.position.z), Quaternion.identity);
 var instancesnow2 = Instantiate(terrainpplane, Vector3(transform.position.x - 500, 0, transform.position.z), Quaternion.identity);
 var instancesnow3 = Instantiate(terrainpplane, Vector3(transform.position.x  , 0, transform.position.z + 500), Quaternion.identity);
 var instancesnow4 = Instantiate(terrainpplane, Vector3(transform.position.x  , 0, transform.position.z - 500), Quaternion.identity);
 spawn = true;
 boom = true;
 Destroy (this);
 }while (!other.CompareTag ("Player"));}}}




NOTE i have tried using sphere collider but it doesnt work and instead deletes itself even when it's not touching anything and it is the only thing in the scene -- It spawns plane prefabs which randomly changed with other scripts -- "snowprefab" is from a previous game i made, i will change it later

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 trs9556 · Aug 12, 2013 at 02:32 AM 0
Share

This doesn't really answer your question but it might be relevant. I'm not exactly sure what you are trying to do but my assumption is you want a infinite terrain. Why reinvent the wheel?

http://forum.unity3d.com/threads/68807-Infinite-Terrain-Free-Project-Source

http://upshift.org/2012/02/building-endless-terrain-in-unity3d/

http://forum.unity3d.com/threads/174595-TerrainEngine-$$anonymous$$arching-Cubes-Infinite-Procedural-Smooth-Terrain

Ignoring these you should look into using Terrain.SetNeighbors to seamlessly place a terrain grid.

avatar image minecraftkingza · Aug 12, 2013 at 11:44 PM 0
Share

I like the idea of a few of them, but i want to make the map render similar to "cubeworld" were it renders the surrounding 4 planes except the ones that already have loaded. i like the Terrain engine and think it would be perfect for what i want but i cant spend £3000 on something that isnt even the main aspect of my game, i would like it simpler and free if possible.

0 Replies

· Add your reply
  • Sort: 

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

16 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

Related Questions

Respawn random objects 1 Answer

Collision detection problems with plane + 2D Sprites 0 Answers

Assign particle collision in code? 0 Answers

Using the UnityEngine.Plane struct, what's the best way to check if a collider is crossing said plane? 0 Answers

Multiple collision areas within plane 0 Answers


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