First thing I am going to say is, you may want to take a step back and work through a few more basic tutorials before trying this project. You may not be ready yet. Each answer seems to lead to more questions which means you really could use some more experience with the engine (and game design in general). This isn't meant to discourage you. In fact, struggling with a bigger project than you are ready to complete is the more discouraging thing here and after getting some more knowhow first will lead to a better project in the end.
That being said, Here is an example file that I hope can show you how to solve these problems.
The game freezing is caused by an endless loop. This means the while loop used to draw your ray is never finding an end point so it is continuing off into infinity. The events that happen after the loop are never reached and eventually the computer will run out of memory. This is solved simply by guaranteeing the ray stops growing at some point. In the example, I give it a max length as one of the conditions for the while loop. Any time you are using a while loop in your game, if the game freezes, the first thing to check is if there is an endless loop.
Again, for the angle of the arrow, I will have to make some assumptions. I assume you are using the orbit behavior. This would seem to make sense because you want it to orbit the heart. However, some of the functionality of the orbit behavior (the way it rotates the object for example) is not compatible with the result you are looking for. For my example, I found it better to use the rotate behavior and set the origin of the arrow a little to the left of the sprite. To see this, edit the sprite and look at the position of the origin. If you then set the position of the arrow to the position of the heart, the rotate behavior will rotate the arrow around the arrows origin causing it to appear to orbit the heart. I then pinned the arrow to the heart, without allowing the pin to set the rotation, to ensure the arrow stays with the heart.
There are of course other ways to fix the angle. For example, you could disable the orbit functions rotate property and use events to manually set the angle. But I'm lazy so I would rather not do that extra work.
You'll notice the player uses a variable to ensure the teleport isn't automatically triggered on arrival at the end destination.