# How to make animation length variable

**URL:** <https://discourse.psychopy.org/t/how-to-make-animation-length-variable/23874>\
**Category:** Coding\
**Tags:** timing\
**Created:** [July 5, 2021, 3:50am UTC](https://discourse.psychopy.org/t/how-to-make-animation-length-variable/23874 "2021-07-05T03:50:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kombatkarl](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@kombatkarl](https://discourse.psychopy.org/u/kombatkarl)\
**Post date:** [July 5, 2021, 3:50am UTC](https://discourse.psychopy.org/t/how-to-make-animation-length-variable/23874/1 "2021-07-05T03:50:45Z")

</div>

Hiya!

I had an animation whose perceptual tweaks I’ve worked out exactly as I want them. The only issue is now, I have to make the animation run with the same effect but take different amounts of time to execute. I can achieve this using by adjusting the speeds at which the stimulus moves but is there anything built into PsychoPy that can acheive the effect?

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 5, 2021, 10:30am UTC](https://discourse.psychopy.org/t/how-to-make-animation-length-variable/23874/2 "2021-07-05T10:30:27Z")

</div>

Do you mean like (in Each Frame)

```auto
if t > animationLength:
     continueRoutine = False

```
