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 Staln · Jun 13, 2013 at 01:43 PM · flash

How to show the flash effect in Unity

I am Unity beginner. Here is a flash link. link text

You can set the limit of split.

and touch the square that start to split.

Square split to the limit you set will restore to origin square.

I don't have a idea how to show effect like this in Unity.

Someone can give a hint?

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 ahaykal · Jun 13, 2013 at 02:59 PM 0
Share

Just letting you know that we don't give scripts here. We won't write you a full script (unless someone got generous).

So what I think he did is used animations to split them and then reversed the animation.

avatar image Staln · Jun 13, 2013 at 03:23 PM 0
Share

Because it can adjust the limit from 32 to 512. If I recorded the video, I must record 480 video,right?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by DaveA · Jun 13, 2013 at 03:40 PM

This looks like it was done by program, not animation. Probably a fractal. Google 'fractals' to see how that's done (hint: probably 'recursion'). So he splits the one object (square) into two or more new objects (rectangles). He applies some animation code (translation) to each of those objects to move them apart. He turns off rendering the original object. Then pauses, then repeats the process on the new pieces. Does that X number of times, where X is 32 to 512.

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 DaveA · Jun 13, 2013 at 03:41 PM 0
Share

By the way, in Unity it would be just as easy to do this in 3D rather than 2D for even cooler effect

avatar image
0

Answer by Staln · Jun 15, 2013 at 10:38 AM

I want to show flash fission effect. I let cube object to instantiate two prefab and hide itself. And wait 2 sec, each prefab create two prefab again and hide itself. The created object can smoothly separate at first, but second time fission the created object reach end point rapidly .

I no idea where is going wrong?

 #pragma strict
 
  var myObject:GameObject;
 static var totalNum:int=1;
 
 private  var fission1:GameObject;
 private  var fission2:GameObject;
  
 private var fission1Vector3:Vector3;
 private var fission2Vector3:Vector3;
 private var parentHide:boolean=false; 
 private var locHorDirection:boolean;// Apart direction
 private static var horDirection:boolean=false;//// Apart direction
 private static var fissionTime:float=0;
 private static var isFirst:boolean=true; 
 function Start () {
    
    if(!isFirst)
    {
     
      yield WaitForSeconds(2);
     
      
    }
    isFirst=false;
    
      Debug.Log(this.gameObject.name);
   
      if(!parentHide&&totalNum<4)
      {
        if(horDirection)
       {  
       var randX:int=Random.Range(1, 9);
       var parentX:float=renderer.bounds.size.x;
       
        fission1Vector3=transform.position;
        fission2Vector3=transform.position;
       
       fission1Vector3.x+= parentX*0.25;//(parentX*(randX/10.0))*(parentX*(randX/10.0));
       fission2Vector3.x-= parentX*0.25;//(parentX*((10-randX)/10.0))*(parentX*((10-randX)/10.0));
       
       fission1= Instantiate(myObject,fission1Vector3, Quaternion.identity);
       fission2= Instantiate(myObject,fission2Vector3, Quaternion.identity);
       
       fission1.transform.localScale.x*=0.5;//(randX/10.0);
       fission2.transform.localScale.x*=0.5;//((10-randX)/10.0);
       
      // fission1.transform.position=fission1Vector3;
      // fission2.transform.position=fission2Vector3;
      
     
       totalNum++;
       renderer.enabled=false;
       parentHide=false;
       locHorDirection=horDirection;
       
       if ((totalNum & totalNum - 1) == 0)//determine if 2's power
        {
         horDirection=!horDirection;
         fissionTime++;
        }
       }
     
       else
          {  
       var randY:int=Random.Range(1, 9);
       var parentY:float=renderer.bounds.size.y;
       
        fission1Vector3=transform.position;
        fission2Vector3=transform.position;
        
       fission1Vector3.y+= parentY*0.25;//(parentX*(randX/10.0))*(parentX*(randX/10.0));
       fission2Vector3.y-= parentY*0.25;//(parentX*((10-randX)/10.0))*(parentX*((10-randX)/10.0));
       
       fission1= Instantiate(myObject,fission1Vector3, Quaternion.identity);
       fission2= Instantiate(myObject,fission2Vector3, Quaternion.identity);
       
       fission1.transform.localScale.y*=0.5;//(randX/10.0);
       fission2.transform.localScale.y*=0.5;//((10-randX)/10.0);
       
      // fission1.transform.position=fission1Vector3;
      // fission2.transform.position=fission2Vector3;
      
       
       
       totalNum++;
       renderer.enabled=false;
       locHorDirection=horDirection;
       
       if ((totalNum & totalNum - 1) == 0) //determine if 2's power
        {
         horDirection=!horDirection;
         fissionTime++;
        }
       
       }
      
      }
       
 
 }
 
 function Update () {
 
    
    if(locHorDirection)
    { 
    if(fission1!=null) 
      fission1.transform.position=Vector3.Lerp(transform.position,fission1Vector3+Mathf.Pow(0.8,fissionTime)*Vector3(1.0,0,0),Time.time);
    if(fission2!=null) 
      fission2.transform.position=Vector3.Lerp(transform.position,fission2Vector3+Mathf.Pow(0.8,fissionTime)*Vector3(-1.0,0,0),Time.time);
      
     
    }
    
    
    else
    { 
    if(fission1!=null) 
      fission1.transform.position=Vector3.Lerp(transform.position,fission1Vector3+Mathf.Pow(0.8,fissionTime)*Vector3(0,1.0,0),Time.time);
    if(fission2!=null) 
      fission2.transform.position=Vector3.Lerp(transform.position,fission2Vector3+Mathf.Pow(0.8,fissionTime)*Vector3(0,-1.0,0),Time.time);
   
    }  
         
         
 }
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

17 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

Related Questions

A node in a childnode? 1 Answer

Connecting Multiple Swf files to create a game in Unity 2 Answers

Flash build giving some errors.(Type was not found or was not a compile-time constant) 0 Answers

Option to build with Flash is gone. 1 Answer

Web Player Broken After Exporting To Flash. 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