Inside a with statement, the keyword other refers to the instance calling the statement.
That is good info. That being said, how on earth does the rest of that code work? Because the angle = angleset; and radius = radiusset; inside of the with statement work fine.
Also, still doesn't work. here's what I have.
orbittest Create event:
var inst, i, angleset, radiusset, test;
test = object_index;
angleset = 0;
i = 0;
for(radiusset = 100; radiusset > 0; radiusset -= 15){
for(i = 0; i < 4; i++){
inst = instance_create(x,y,orbitballtest);
with(inst){
angle = angleset;
target = other.test;
radius = radiusset;
angleset += 1.57;
}
angleset += .035;
}
}
orbitballtest Create event:
target = 0;
follow = 0;
angle = 0;
radius = 50;
y = target.y+(sin(angle)*50);
x = target.x+(cos(angle)*50);
orbitballtest Step event:
if(follow == 0){
angle += .013;
y = target.y+(sin(angle)*radius);
x = target.x+(cos(angle)*radius);
}
else if(follow == 1){
follow = 2;
speed = 2.2;
direction = 250 + random(40);
}
if(y<5){
follow = 1;
}
It's worth noting that this works fine if I say target = instance_find(orbittest,1);
But then it only works with one instance of orbittest. Which isn't what I am looking for.