Author Topic: Animation property does not accept variables for start and end?  (Read 2351 times)

Oomek

  • Administrator
  • Sr. Member
  • *****
  • Posts: 311
  • Radek Dutkiewicz
    • View Profile
    • github.com/oomek
Animation property does not accept variables for start and end?
« on: February 28, 2017, 10:37:12 AM »
I found out that the properties used in animation module do not accept variables as a value for start and end for example:

Code: [Select]
when = Transition.ToNewSelection ,property = "y", start = 200 * direction, end = 0, delay = 0, time = 500
When the variable "direction" changes it does not affect the starting position of the animation, is it by design or a bug?

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: Animation property does not accept variables for start and end?
« Reply #1 on: February 28, 2017, 03:59:41 PM »
It would set it, but you have to remember that when you assign variables in the animation properties, that value is assigned at that moment, not when the animation occurs. If the value changes, it would not be updated at a later time.. If you need it set when the animation starts or is running, you can use the onInit, onStart, onUpdate and other functions to set values when necessary.. does that make sense?

https://raw.githubusercontent.com/liquid8d/attract-extra/master/modules/animate.nut