Scripting/Squirrel/Functions/Object.MoveTo: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function move an object to a specified local. == Syntax == <pre>object.MoveTo( Vector pos, int time );</pre> == Arguments == * ''Object'' '''object''' - A valid object...")
 
Line 12: Line 12:
<pre>myObj = CreateObject(1259, 0, Vector(-879.757, -576.008, 11.3371), 255).RotateTo( Quaternion(0, 0, 0.5, -0.866025), 0 );
<pre>myObj = CreateObject(1259, 0, Vector(-879.757, -576.008, 11.3371), 255).RotateTo( Quaternion(0, 0, 0.5, -0.866025), 0 );
myObj.MoveTo( Vector(-979.757, -576.008, 10.3371), 1000 )</pre>
myObj.MoveTo( Vector(-979.757, -576.008, 10.3371), 1000 )</pre>
<pre>function onScriptLoad()
{
gate <- CreateObject( 3685, 1, 384.108, -505.87, 9.65089, 255 );
gate.MoveTo( Vector(384.108, -805.87, 9.65089), 1000 )
}</pre>

Revision as of 23:30, 16 August 2016

This function move an object to a specified local.

Syntax

object.MoveTo( Vector pos, int time );

Arguments

  • Object object - A valid object instance.
  • VECTOR vector - Position where the object will be taken
  • INT time - Time period within which the object has to move, in ms.

Example

myObj = CreateObject(1259, 0, Vector(-879.757, -576.008, 11.3371), 255).RotateTo( Quaternion(0, 0, 0.5, -0.866025), 0 );
myObj.MoveTo( Vector(-979.757, -576.008, 10.3371), 1000 )
function onScriptLoad()
{
 gate <- CreateObject( 3685, 1, 384.108, -505.87, 9.65089, 255 );
 gate.MoveTo( Vector(384.108, -805.87, 9.65089), 1000 )
}