variables for all tansitions?

let’s say I’m using transitions to mount some objects in my game. I wanted to ask if it is mandatory to assign variables to all transitions or can they be left without a variable?

Something like:

local t1, t2, t3 t1 = transition.fadeOut( ball, { time=300 } )

Or simply:

transition.fadeOut( ball, { time=300 } )

taking into account that the transition can go free or within a function or an anonymous function?

Or maybe I should use a table?

Thanks in advance

DoDi

  1. Your question is backwards by the way.  You don’t assign variable to transitions.  You assign the return value of a transition.*() call to a variable.  For discussion sake, let’s refer to the return value as a handle.

  2. If you don’t intend to do anything with the handle in the future, you do not need to assign it to a variable.  

  3. You assign a handle to a variable so you can refer to it later and inspect the state of the transition and/or modify it in some way.  (I don’t mean like change the length or anything.  I mean interact as in pause or cancel).

Thanks! @roaminggamer

  1. Your question is backwards by the way.  You don’t assign variable to transitions.  You assign the return value of a transition.*() call to a variable.  For discussion sake, let’s refer to the return value as a handle.

  2. If you don’t intend to do anything with the handle in the future, you do not need to assign it to a variable.  

  3. You assign a handle to a variable so you can refer to it later and inspect the state of the transition and/or modify it in some way.  (I don’t mean like change the length or anything.  I mean interact as in pause or cancel).

Thanks! @roaminggamer