I am trying to move a platform back and forth, but my logic to do so is not quite there.
Any help with guiding me to the correct approach is appreciated.
Here is my code.
local function movePlatform(self, event) if self.x ~= screenWidth - 110 then self.x = self.x +1 end end
So the above code moves the platform to the right then stops, that was the easy part. I’m having a hard time with bringing the object back to its original location only to move over again, so the platform would move side to side.
The movePlatform function triggers on a Runtime enterFrame event listener.