I am creating a project (fishing Game) that involves a long line with a hook at the end that is supposed to catch objects(fish) moving across the screen. When the fish collide with hook I want a function to run. However I only want the function to run when the hook is contacted not the rest of the line. The hook is part of the same SKSpriteNode as the line. How can I make the physics body of the line be at the very bottom, so that the function is only called when the fish hit the hook or bottom of the line? I already know how to change the size of the physics body just not the location.
Make your line 2 Sprites, Line and hook, and have hook be a child of line. Give each sprite its own physics body, with its own category. By doing it this way, you can create some neat effects if you use SKPhysicsJoint, to give it the appearance of a hook dangling from a line. If you still want to keep it as 1 Sprite, then when you are creating the Physics Body, some of the constructors have a center that you can manipulate. Your other option is you use an SKNode, add the physics body to that, add this new node to your sprite, and move the node to the hook