I tried out Klazen's 'wobble' code:
//Create event
wobble_speed = 2*pi/room_speed; //speed of the wobble
wobble_distance = 32; //distance of the wobble
aa=0;
//Step event
aa+=wobble_speed;
y = ystart + wobble_distance*sin(aa);
but I want to use it in a slightly different way. I'm trying to figure out how to set it up so that you place an instance in the room, and edit the creation code to have the same effect. It seems that this way, any instance you place will have the same properties and the wobbles will be in-sync. But what if I wanted to control each instance, and make them all wobble differently (instead of making more objects)?
I tried to setup some variables to call from the creation code but I keep getting an error saying "objWobble.(variable) not set before reading it." I tried something along the lines of this:
//Create event
wobble_speed = wobbleSpeed*pi/room_speed; //speed of the wobble
wobble_distance = wobbleDistance; //distance of the wobble
aa=0;
axis = axisStart + wobble_distance*sin(aa); //
//creation code
axis = x;
aixsStart = xstart;
wobbleSpeed = 1;
wobbleDistance = 32;
I know the variables have to be initialized first, but even when I did get GM to accept the code, there was no wobble. How would I set this up?