Enemies following the player

Hi i have a space game app and you are a player on the screen and can move it with a joystick. the height of the scene is 320 and the width is 10,000. I have an actor that is constrained to the player that is called collision and when enemies crashes into it the actor is destroyed. i have an enemy spawner that randomly spawns around the screen so enemies come flying in and try to crash into the player from all directions. The player controls the camera and the camera can only move left or right. The enemies follow the player until the camera moves to the right then the enemies just fly a certain distance to the right of the player and explode (instead of crashing into the player) but if you restart the scene and dont cause the camera to move the enemies come flying right at you. The collision is perfectly centered with the player the whole time. But ive found a hint to this matter... when i make the enemy spawner scrollable on the scene then the enemies follow you perfectly the whole time but then the spawner is left behind to the left side which causes the enemies to only spawn on the left... please help ive been trying so hard to fix this issue. Thanks!

Comments

This discussion has been closed.