This sample demonstrates the use of scripts to control scene items.
Click on the image to install the sample.
| 
|
After installing the package, an instance of the Tree class is added to the scene, as well as a floor Grid. This instance has an event, OnUpdateChanged. This means the script is activated everytime the object is updated.

Also, in order to enable the Update event to fire, you need to change the FireUpdate property on the Spatial tab of the Tree instance to True.
Here's is what the OnUpdateChanged event script contains.
The first line initializes a position to the world origin (0,0,0).
Vector3 pos = Vector3.Zero;Next, a scalar value is obtained by scaling the context SceneTime (the amount of time passed since last update).
float speed = (float) context.SceneTime * 0.4f;This scalar is the used in conjuction with Sine and Cosine, to generate a circular position on the XZ plane.
pos.X = (float) Math.Sin(speed);pos.Z = (float) Math.Cos(speed);It is then scaled to give a bigger (or smaller) circle.
pos *= 5;Finally, the new position is set on the Tree's local position.
context.Spatial.Local.Translation = pos;This makes the tree in the scene move in a circle around the floor Grid. You could try changing the '5' multiplier to make a bigger or smaller circle, or change the '0.4f' to make it circle faster or slower.