Hi all:
I’m designing some scientific visualization applications for education within Unity 3D. I need to create many copies (a few dozen to several hundred) of an object (for example spheres or cubes) and have each of those objects wiggle around its own center point. Each object has to wiggle a little differently from the rest (unique random seed for each). The wiggling has to be maintained within certain pre-determined parameteres such as frequency, and angle on the X, Y, and Z axis. Is this possible to do within Unity 3D? If so, can anyone guide me in the right direction on writing a short script or some other technique to accomplish this?
I can do this in 3DS Max by selecting all of the objects and then applying a Maxscript (that I wrote) to all the selected objects, but this type of “procedural” animation does not export from Max to Unity 3D. This is why I need to figure out how to do the animation all within Unity 3D.
Thanks,
huertaaj
make a script that stores the center position and the wiggle offset, and then make the wiggle offset be the sin(time) and add multipliers to the sin and time to control amplitude and frequency, do that for x y and z! and voila!
Perlin noise works great for object wiggles, camera shakes and the like.
p.s. wrong forum unless you wish to gossip about shaking things.
OK, I forgot to say that I’m very new to Unity 3D and I’m not that much of a programmer or scriptwriter. I’m pretty much in the dark about the things you suggested. Is there a resource that I could turn to to get me started on writing short animation scripts for Unity 3D objects? Is there a “nosie” function in Unity 3D?
Which forum should I post this in? I thought this was the “blah blah blah” forum where we could talk about anything regarding how to do things in Unity 3D.
That would generally be the support forum. If you notice, most of the posts here are of the ‘off-topic’ or industry news ilk.
There is a perlin noise class in the procedural content example project. Look in the resources section of the Unity website. As for how to plug it in and get your object to shake, try searching the forums with google for ‘camera shake.’ I’m sure someone’s done it before.
I’m sorry, I didn’t know that this was the wrong location to post my question (I’m new here). Should I re-post my question at the Unity Support location or will someone at Unity 3D move it there for me?
Many thanks,
huertaaj
For performance I’d say use a vertex shader to displace the vertices, although without being able to reference a texture in the vertex shader (at least I haven’t noticed that had been added), you’ll have to generate the displacement in the shader instead of using a noise texture. If they have added the ability to reference a texture in the vertex shader, please let me know!
Look into the free iTween library or the visual iTween editor, both downloadable from the Asset Store (Window/Asset Server or command 0 on the mac). You can easily do this kind of thing using that. Both the library and the visual editor also have support documentation and examples (on the author’s sites at least) which should help you further if you need it.