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 Remaka · Apr 13, 2013 at 01:10 PM · animationplatforms

How can I create an animation of platforms

Hi guys. I want these platforms to get activated and start rising in case a player passes by, or moving randomly according to music as equalizer, can you help me? alt text

возраждение феникса.png (367.7 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by behzad.robot · Apr 13, 2013 at 02:26 PM

Well i think i may be able to help a little bit: -Create a zone script and attach it to a big box which is covering the boxes and some space around them then remove the mesh renderer component for sure then make it's collision as a trigger this Zone's script will call a function attached to father of these boxes which this function is going to make the boxes moving randomly. Zone.js:

 public var Boxes:GameObject;
 function OnTriggerEnter(other:Collider)
 {
    if(other.gameObject.tag=="Player")
    {
         Boxes.GetComponent(Shuffler).Shuffle();
         //well lets call that funciton Attached to Boxes father Shuffle
    }
 }


Shuffler.js(Attached to boxes father):

 public var children:GameObject[];
 public var MaxForce:Vector3;
 function Shuffle()
 {
     //well u can replace any other algoritm u want to here !
     for(i=0;i<children.length;i++)
     {
         //lets genrate some random force u may need to adjust this part a little bit if u dont want them to go all around!
         var randomForce:Vector3;
         randomForce.x=Random.Range(-MaxForce.x, MaxForce.x)
         randomForce.y=Random.Range(0, MaxForce.y)
         // i made it between 0 and max force caz i thought u wont need to shoot them down and then have them bounce back :/
         randomForce.z=Random.Range(-MaxForce.z, MaxForce.z)
         
         children[i].rigidbody.AddForce(randomForce)
         
     }
 }

az i've told u before u may need to adjust algoritm used in shuffle function but i just tried to help and i've gotta admit i have no idea what to do about them music thing but u can add an increasing force algoritm instead of this random thing so that each of them is jumping more (or maybe less ) than the one before it that's good idea i think.:D

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

11 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

Related Questions

Platform Triggers & Animation 0 Answers

Can the animation editor create local rotational data? 3 Answers

Adding animation clips via script 2 Answers

Can I make animations snap to a frame? 1 Answer

How to select an animation clip by index number? 7 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