Mbs
Forum Replies Created
-
Oops! (errant mouse click)
Finally got a chance to try this out. Thanks so much for your help. While the first part (the expression for the cannon’s position) is giving me positions outside of the frame, I’m still having the problem of some particles being “born” within the frame.
My null Layer is animating around the frame (in a square – lower left, upper left, upper right, etc.) over the course of 20 sec, so the code I’m using is:
variation=random(0,20);
helper=thisComp.layer(“circler”);
new_X=helper.position.valueAtTime(variation)[0];
new_Y=helper.position.valueAtTime(variation)[1];[new_X,new_Y]
(where circler is the name of my null object).
Any thoughts on why particles are popping up in the frame? Could it be my other settings?
In addition, the second part (the angle the cannon fires) seems to be acting weird.
The code suggested:helper=thisComp.layer(“Cannon Helper”);
helper_X=helper.position[0];
helper_Y=helper.position[1];
center_X=thisComp.width/2;
center_Y=thisComp.height/2;
diff_X=helper_X-center_X;
diff_Y=helper_Y-center_Y;angle=readiansToDegrees(Math.atan2(diff_Y,diff_X));
First of all, am I correct in thinking that the first line should actually be grabbing the position of the Cannon, and not the Cannon helper? With that difference, i’m still getting erratic angles. I added a Slider Control to debug, and Diff_X and Diff_Y seem to be coming out all right, so I figure the problem is in the last line (apart from the typo in “radians”). Anyone have any ideas? Thanks in advance.
-
Oops! (errant mouse click)
Finally got a chance to try this out. Thanks so much for your help. While the first part (the expression for the cannon’s position) is giving me positions outside of the frame, I’m still having the problem of some particles being “born” within the frame.
My null Layer is animating around the frame (in a square – lower left, upper left, upper right, etc.) over the course of 20 sec, so the code I’m using is:
variation=random(0,20);
helper=thisComp.layer(“circler”);
new_X=helper.position.valueAtTime(variation)[0];
new_Y=helper.position.valueAtTime(variation)[1];[new_X,new_Y]
(where circler is the name of my null object).
Any thoughts on why particles are popping up in the frame? Could it be my other settings?
In addition, the second part (the angle the cannon fires) seems to be acting weird.
The code suggested:helper=thisComp.layer(“Cannon Helper”);
helper_X=helper.position[0];
helper_Y=helper.position[1];
center_X=thisComp.width/2;
center_Y=thisComp.height/2;
diff_X=helper_X-center_X;
diff_Y=helper_Y-center_Y;angle=readiansToDegrees(Math.atan2(diff_Y,diff_X));
First of all, am I correct in thinking that the first line should actually be grabbing the position of the Cannon, and not the Cannon helper? With that difference, i’m still getting erratic angles. I added a Slider Control to debug, and Diff_X and Diff_Y seem to be coming out all right, so I figure the problem is in the last line (apart from the typo in “radians”). Anyone have any ideas? Thanks in advance.
-
Finally got a chance to try this out. Thanks so much for your help.
The first part seems to work well ( -
Finally got a chance to try this out. Thanks so much for your help.
The first part seems to work well ( -
Thanks so much for the help! I’m trying it out now… i’ll let you know how it goes.
-
Thanks so much for the help! I’m trying it out now… i’ll let you know how it goes.
-
Thanks for your help, guys, i’ll try both techniques!