Question
if else troubles and issues.
var speed = 610;
var bottomValue = 1150;
var topValue = -70;
var distance = bottomValue - topValue;
var time = distance / speed;
var currentTime = time % 2;
var currentPosition = linear(currentTime, 0, 1, topValue, bottomValue);
if (currentPosition >= bottomValue) {
currentPosition = topValue;}
[value[0], currentPosition];
the code is suposed to make the shapes go from the starting position then travels down to y1150 then teleports back up to -70 and repeats with a speed of 610 pixels per second, but the if else statement makes the shape motionless, how do i fix this or get around this?
