Example Script: Follow the Path

The example script, Follow the Path (FollowThePath.cs), which moves a dynamic object along a route of waypoints in a loop. Grab it at the download link at the end of the page.

Here is a step-by-step guide to using the script:

  1. Download the script file from the download link at the end of this article.
  2. Follow the instructions provided in Working with scripts to upload the script and add it to an object.
  3. Open the object's Properties panel and go to the Script Settings section. 
  4. On the properties panel, set IsDynamic to On.
  5. At the bottom of the object's properties panel is a Script Settings section. Upon looking at the Script Settings section for FollowThePath, you will see a list of parameters which you can set for the object. Setting values on these parameters can help you set the movement of your object.
  6. Once you have finished setting the parameters for your object, your script is ready! Save and build your scene.
  7. If you want to verify that the script is running correctly, visit the scene once it has been built.   

Script parameters

Speed

Speed allows you to set the speed of an object. It is best to set the Speed value between 5 to 25.

Position 1

Position points help define the route of your object along an intended path.

The object's starting position is always at the point at which the object was placed. In total, you may add up to 7 position points for each object by filling the <x,y,z> points with values. However, you may also choose to have fewer position points.

By default, <0,0,0> is set as the <x,y,z> position point for all position points. When <0,0,0> is set, no position point is assigned to that slot.

Position 2
Position 3
Position 4
Position 5
Position 6
Position 7
Loop If Loop is set to ON, the objects will move and follow the route of points repeatedly. If Loop is set to OFF, the object will warp to the start point after it reaches the end of the defined position points. 
On Collide TP Dest On Collide TP Dest allows you to set a teleport function. If set, an avatar will be teleported to the defined position point when the object comes into contact with it. 

Creative Commons License  

This content is licensed under the terms of the Creative Commons Attribution 4.0 International License. When using this content, you must:

  • Acknowledge that the content is from the Sansar Knowledge Base.
  • Include our copyright notice: "© 2017 Linden Research, Inc."
  • Indicate that the content is licensed under the Creative Commons Attribution-Share Alike 4.0 International License.

Include the URL for, or link to, the license summary at https://creativecommons.org/licenses/by-sa/4.0/deed.hi (and, if possible, to the complete license terms at https://creativecommons.org/licenses/by-sa/4.0/legalcode.

For example:

"This work uses content from the Sansar Knowledge Base. © 2017 Linden Research, Inc. Licensed under the Creative Commons Attribution 4.0 International License (license summary available at https://creativecommons.org/licenses/by/4.0/ and complete license terms available at https://creativecommons.org/licenses/by/4.0/legalcode)."

Download link 

Was this article helpful?
9 out of 9 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.