ID:2151782
 
Code:
animate(I1, transform = matrix(108, MATRIX_ROTATE), time = spin_num, loop = -1)
animate(transform = matrix(-108, MATRIX_ROTATE), time = spin_num)
animate(transform = null, time = spin_num)


Problem description:
Fairly new to animate and matrix functions but could use a little help. I am trying to get the ball ends of the light to ease in and out while it rotates around the obj. I tried scale but the outcome has weird results.

http://files.byondhome.com/DarkerEmerald/scrnshot1.png
108 is a weird angle to use. Sounds like you actually want 120. But whatever.

I would assume you just need to do a scaling matrix and multiply by the rotation. What exactly did you try to do?
I actually figured out the problem through trial and error. But trying it this way seemed to have achieved what I wanted.

var/obj/line/O = new(src.loc)

var/turn_start = rand(1, 359)
var/matrix/m = matrix()
m.Scale(0.1, 0.1)
m.Turn(turn_start)

var/spin_num = rand(10, 20)

animate(O, transform = turn(matrix(108, MATRIX_ROTATE), turn_start), time = spin_num, loop = -1)
animate(transform = turn(matrix(-108, MATRIX_ROTATE), turn_start), time = spin_num)
animate(transform = m, time = spin_num)
If all the times are equal, I would strongly suggest using 120 as an angle instead of 108. I've only ever used 108 in examples when the time was different. Your rotation is going to look weird with these times and angles.

With these angles, the first and third calls should take up 30% each of the total time, and the second should be 40%--because the first and third are moving by 108 degrees, and the second is by 144.
Yeah I used the ones that were in the help guide and thanks for the heads up.