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 /
This question was closed Oct 12, 2014 at 02:46 PM by robertbu for the following reason:

Design/discussion question

avatar image
0
Question by Auto-Bot · Oct 12, 2014 at 02:45 PM · instantiateterrainprefabdelayvoxel

Instantiating multiple objects, Destroying and instantiating on trigger + delay

So what I'm trying to do is set up a semi large area with a "terrain" or plane made of cubes. The player is confined to movement along the X axis. I've got a simple script that instantiates a green cube prefab at the position of the gray cube on trigger, this works fine.

C#

     using UnityEngine;
     using System.Collections;
     
     public class DestroyObjectReplace : MonoBehaviour {
     
         public GameObject myPrefab;
     
         void OnTriggerEnter (Collider collider) {
             if (collider.gameObject.CompareTag ("Player")) {
                 Instantiate(myPrefab, transform.position, transform.rotation);
                 Destroy (this.gameObject);
                 
             }
     }
     }

Pavers

Here's what I'm having trouble conceptualizing. The idea is that the world around the player changes as he advances through the world. I've used the same script as above to change the tree models, and I'll likely use it to change other models within the scene as I need them.

My current idea would be to create a plane made of hundreds of cubes, and as the player walks over the pavers, it would also trigger those to instantiate a new cube and destroy the old, but have a delay in each so it looks like a "wave" effect. I've uploaded a rough idea in gfy form: http://gfycat.com/WideGrandioseIndianspinyloach

So I've got the idea, but not the knowledge of how to implement that. I've been searching for a couple days now but I fear perhaps I'm not using the right keywords.

Any help is appreciated! Thank you :)

Comment
Add comment · Show 1
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 robertbu · Oct 12, 2014 at 02:48 PM 0
Share

Design/discussion questions should be asked on Unity Forums. Unity Answers addresses single, specific technical questions. If you post there, consider including a link in this question so that anyone interesting in following or contributing to your question from this list can find the discussion.

I think your implementation will be too CPU intensive. Google 'Voxels' and '$$anonymous$$inecraft' on this list for alternates.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Terrain: Use as scenario (individual) and prefab (unchanged, reusable) 0 Answers

Instatiating an object. Altering that new object causes prefab to be altered. 2 Answers

Make a simple tree 1 Answer

Editing Terrain prefabs directly from a custom editor window. Updates not applying to scene instances. 0 Answers

Instantiate prefabs next to each other? 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