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 JokerMartini · Jul 18, 2012 at 06:33 PM · animationobjects

Procedural Object creation + Animation (language 'any') + video link

How would I proceduraly duplicate an existing object in the scene and apply procedural animation to it using just math. I would like for this to be done in c# if possible. but if its easier or someone has a solution for it in another language I'm completely open to it.

If anyone is able to supply a solution feel free to make it super simple.

I have a sphere in the scene and I want to proceduraly duplicate and apply animation to that referenced sphere. The animation itself would be moving the sphere from a random starting point within a 10x10 grid, to its ending point which would be 10 units up(Z-axis) over the course of a half a second. I really hope this is a possible think and that guys can help me out.

example = http://www.youtube.com/watch?v=-CTmD5vrHSg&feature=youtu.be

Thanks John

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 Mortoc · Jul 18, 2012 at 07:27 PM

It is very easy to copy any object. Use UnityEngine.Object.Instantiate

You can also procedurally move things around very easily in unity: "GameObject.transform.position = someVector3;" You can change "someVector3" per frame and make it follow any sort of math you want. Unity's Coroutines make functions execute over a time in a way you can procedurally control, I'd say give them a try, it'll give you a good idea how to do this.

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 JokerMartini · Jul 18, 2012 at 08:15 PM 0
Share

How do I specify where these objects are to be created. Can I somehow place spawn points in the scene and use those as the points in which the spheres will be instanced to as their starting positions?

avatar image Mortoc · Jul 18, 2012 at 08:21 PM 0
Share

Yes, you can do that. If you follow the getting started with Unity tutorials, by the time you're done, you'll have no problem doing this sort of thing.

http://docs.unity3d.com/Documentation/Images/manual/ScriptingTutorial.pdf

avatar image JokerMartini · Jul 18, 2012 at 08:37 PM 0
Share

Would you be able to help me mock up just a quick sample of how this is written. I'm new to unity and this is my first build of any kind so any examples would be greatly appreciated. I understand what I'm after but I'm not quite sure how to write these things. The more examples I see the more I'll be able to take it from there and go crazy. I'm familiar with the concept of scripting as I've done my fair share in 3d applications like 3ds $$anonymous$$ax and $$anonymous$$aya, but not unity.

These are the steps I'd like to see how would be written together and from there just explain how a fresh new scene would be setup. I created a sphere and a new js script but I'm not sure where to place the script, and does the object being duplicated have to be in the scene or just in the project?

Steps: 1. Using Instantiate to duplicate a GameObject 2. Give the new instanced object a unique name 3. Using an array of predefined locations in 3d space place the newly duplicated object. (these locations could be defined by using spawn points? if possible) 4. Apply a simple procedural animation to the object over the course of 10 frames.

avatar image JokerMartini · Jul 18, 2012 at 09:32 PM 0
Share

Where is the location of that tutorial. I was going to see if there were more scripting ones in that same level of detail. It definitely helped make sense of some stuff.

avatar image JokerMartini · Jul 19, 2012 at 12:24 AM 0
Share

AWESO$$anonymous$$E! Great news. So from the linked pdf I've been able to do steps 1 & 3. Now I'm trying to figure out how to apply a procedural animation to the objects. I do not have to bother doing the unique name since I'm just instantiate a prefab....correct?

Thanks again for you help. It's been super helpful.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Can't "Add Property" to animation! 1 Answer

Can I make animations snap to a frame? 1 Answer

How to enable disable items effects with key with best way? 1 Answer

How to select an animation clip by index number? 7 Answers

Using the same animation on duplicate objects. 2 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