I am trying to develop a platformer using Swift/Spritekit/Scene Editor and am struggling a bit with one element of my game. So in the game I have some platforms raised off the ground and want the enemy to be moving left/right changing direction when reaching the end of the platform.
What is the easiest way to determine if my sprite which is running an SKACTION for movement is reaching the end? I could of course put a small object at the end of each platform and use collision detection but I want the platform completely flat.
I have searched all over the place and as yet have not come across anything that addresses this question.
Any help or advice would be very much appreciated.
Couldn’t you use an invisible object that still gives you a collision detection notification that you use only for avoiding the edge of the platform?
I did wonder that myself as to whether that might be an option however I do need to be able to have my player still walk through it and also if I make it invisible/hidden doesn’t that mean that it doesn’t exist in the physics world?