You’ll probably need to add a if check after you add to count to check whether speed * delta is more than count. If you do not need to do anything special when count is over total, then you could also just use clamp.
Either way, something like the following should hopefully fix the problem:
# other code above...
if start_rotation and count < total:
# Method one, use clamp
count = clamp(count + speed * delta, 0, total)
# Method two, use a if check
# count += speed * delta
# if (count > total):
# print (“count is more than total. Do any processing needed here!”)
# count = total
pin.translate(Vector3(-speed * delta, 0, 0))
Hopefully this helps :smile: