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 jack 1 · Jun 26, 2010 at 04:38 AM · detonatortimed

Setting timed detonations with the detonator kit

Well I imported the detonator package, really liked it, and wanted to use it for force power type things, for which it worked well. The problem was I also wanted it to do some cool effects for animations, like ex/ a pic of the earth having one nuke going off on it, then 4 more, then a whole bunch of them, but how do I set a time constraint, so that they will go on after x seconds?

At the top it mentions explode() can set it off after a time, but I have no idea how to format that. I think it may be simplier than actually rewritting an addtional code.

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 qJake · Jun 26, 2010 at 06:48 PM 0
Share

Why did you post the Detonator code? We all know what it looks like, there's no need to clutter up your post, you could have just asked how to use it.

avatar image jack 1 · Jun 27, 2010 at 12:41 AM 0
Share

Still new to this type of environment

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by qJake · Jun 26, 2010 at 06:38 AM

You can write a script to do it, using one of the following two methods:

Coroutines

Use a coroutine, something like this:

void Start() { StartCoroutine(BlowStuffUp()); }

IEnumerator BlowStuffUp() { yield return new WaitForSeconds(5); // Spawn explosion here yield return new WaitForSeconds(3); // Spawn more of them here }

Invoke

Use Invoke(), like this:

void Start() { Invoke("Detonate", 3); }

void Detonate() { // Spawn explosion(s) here. }

Edit:

Since you edited your post and asked yet another question, you use Detonator simply by instantiating one of the prefabs it gives you. When a detonator object is spawned, it explodes, and then it automatically cleans itself up when it's done, so all you need to do is Instantiate() one of the prefabs.

Comment
Add comment · Show 5 · 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 Cyclops · Jun 26, 2010 at 03:53 PM 0
Share

But... what if I want Javascript? Where's the Pseudocode? :)

avatar image jack 1 · Jun 26, 2010 at 04:03 PM 0
Share

Don't worry that was only half my question, I just wanted a start :)

avatar image Cyclops · Jun 26, 2010 at 04:08 PM 0
Share

@jack, that comment was aimed at @SpikeX, since he's so fond of Pseudocode :) http://answers.unity3d.com/questions/13485/should-we-use-pseudocode-more-on-unityanswers

avatar image jack 1 · Jun 26, 2010 at 05:04 PM 0
Share

haha I know that, but the point was even still I didn't ask the complete question, which is an alternative to pseudocode, having users be limited to one part of their questions answered properly, so less knowledgable programmers would not be confused, but would have a start ins$$anonymous$$d to work from.

avatar image qJake · Jun 26, 2010 at 06:41 PM 0
Share

@Cyclops Haha... I'm not fond of it, I just wanted to start a discussion to see if it would be useful here ;) Still, touch. :P

avatar image
0

Answer by Symyon · Nov 23, 2012 at 03:33 PM

Uncheck the explodeOnStart option, and then ,in your code, call the Explode() method whenever you want.

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

1 Person is following this question.

avatar image

Related Questions

Detonator Kit, Explode when hitting key 1 Answer

Unity Explosion Framework didn't work 0 Answers

Timed intervals? 2 Answers

Detonator and it's volume threshold 0 Answers

Detonator Framework works, but explosion edges are noticeable 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