Sign in to follow this  
Followers 0
Sheep_Wizard

How to change a vector?

4 posts in this topic

Let say i have this:
 

origin = (2,5,10);

 

And i want to be able to change the Y value by triggering something, how would i do this, iv tried a few things but keep getting errors?

 

0

Share this post


Link to post
Share on other sites

Let say i have this:

 

origin = (2,5,10);

 

And i want to be able to change the Y value by triggering something, how would i do this, iv tried a few things but keep getting errors?

Can you not just assign a variable to one of the coordiantes?

Such as below,

y_axis = 5;

origin = (2, y_axis, 10 );

and then change the y_axis variable on trigger?

0

Share this post


Link to post
Share on other sites

origin[1] = 123;

 

that changes the 2nd value which is y

0

Share this post


Link to post
Share on other sites

Probably easier if i show you what im doing, im trying to make a clone that i can move:

 

clone()
{
     self.clone = [];
 
for(p=0;p<1;p++)
self.clone[p] = self clonePlayer(10);
 
while(level.mirror == 1)
{
    if(isDefined(self.clone[0]))
{
 
self.clone[0].origin = self.origin + (0,level.y_axis,0);
 
 for(k=0;k<1;k++)
 self.clone[k].angles = self.angles + (0,180,0);
 
 
}
wait 0.05;
 
} 
 
}
 
trig()
{
 
    trig = getent("brush1", "targetname");
level.y_axis = 92;
for(;;)
{
    trig waittill("trigger");
level.yaxis++;
}
 
}

 
I get the clone but I get this error:
 
 
0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0