Sphere.Pos

From Liberty Unleashed Wiki
Revision as of 10:36, 11 October 2010 by VRocker (Talk | contribs)

Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Sphere class member returns or sets the position of the given sphere.

Syntax

You can either return or set a new value using this member:

  1. Vector Sphere.Pos
  1. Sphere.Pos = Vector vPos

Arguments

  • vPos - This is the position of the sphere as a vector

Example 1. Returning

  1.  
  2. function onPlayerFootSphereHit( player, sphere )
  3. {
  4. MessagePlayer( "The current position of this sphere is: " + sphere.Pos, player )
  5. }
  6.  

This example will return the position of the sphere when the player hits it.

Example 2. Setting

  1.  
  2. function onPlayerFootSphereHit( player, sphere )
  3. {
  4. sphere.Pos = Vector( player.Pos.x + 2, player.Pos.y, player.Pos.z );
  5. }
  6.  

This example will set the position of the sphere to be 2 x co-ordinates away from the player that hit it.

Notes

The call onPlayerFootSphereHit was used in in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox