I want to create some randomly flying objects in a 3D game. You can imagine them like fireflies. Now there're some tasks to do with them, include:
- They usually fly randomly (of course).
- They can fly away or fly back in some conditions.
I have to write some Javascript to do these things, but I don't know how to do. Can you help me? Thank you very much!
EDIT: I think I'll need these functions:
function Fly()
{
//control the gameObject to fly randomly
}
function FlyAway()
{
}
function FlyBack()
{
}