I’ve been trying to repeat the obstacles when moving to the right or left, but getting into a lot of issues.
I basically made two triggers, one on the right side of the camera and other one on the left(as a child of camera). Whenever they collide with an obstacle, the script clone those obstacles when the trigger enter them and move them forward towards the left or right depending on the trigger that have been pushed and destroy the current one when the trigger leaves them , but when one of the trigger collides with the obstacle that just have been cloned, it starts to clone it on the other side where there is already the other trigger and this cause them to create multiple infinite obstacles on the same locations.
I tried to move the triggers apart so they won’t collide with obstacles that are being cloned and it does work that way but the only issue i have with it, that the clones pop up right in the camera view while the player is moving.
I need the obstacles to be cloned before they enter the camera view instead of popping up in the camera view.
I don’t know if this is going to make much sense to you guys, but i tried my best to explain my situation.
I will really appreciate it, if someone will be able to help me with this.