Here is my situation: I have code which creates an object (moveDest) a set distance away from another object (TestMove), in which TestMove then moves towards moveDest until they both come in contact with each other. Then, the exact same process happens again, but in the opposite direction, and what I WANT is the blocks to be going on a loop back and forth.
I specified in my code that this set-up should repeat for each instance of TestMove, but as a result, it’s causing the code to only run once for some reason. By this, I mean that once it finishes traveling in the opposite direction, TestMove just stops in place, and the cycle doesn’t continue anymore. I’m clueless as to why this is the case, and I’ve been stuck all week on it. I’d be grateful if anyone could help me out on this.
– “posNum” dictates whether it’s traveling in the main direction or in the opposite direction. After it finishes going in the main direction, the value of the variable increases and it starts to travel in the opposite direction. After it finishes going in the opposite direction, the value of the variable goes back to what it originally was, and the cycle is suppose to continue.
– “posDistanceX” dictates how far away moveDest is spawned from TestMove (aka, how far the block is going to travel left and right).
I hope this all makes sense. Thank you if you’re able to lend me a hand…