Made by CodeAlpaca
Special Thanks to DinoDev
Press 1/2 to enter level 1/2
How it work
- I first do "ObjectX-MouseX". This is to find the distance between them on the X plane. (This value will now be referred to as DistX)
- I then do "Math.abs(DistX*3.125)". I find the Absolute value because I do not want a negative number. The *3.125 is that specific number because 100/32 = 3.125. (This value is used the the "X" input on the Size behavior)
- Doing this alone will not work because they sprite expands in both directions equally, so I must account for this and adjust the objects position
- I do "ObjectX+DistX(-1)/2". DistX(-1) is require to move the object in the direction of the hand. The /2 is to get half of the distance between the object and the mouse, because I only need to transfer half of the sprite in that direction. I then + the original X position to keep the corner in the correct sport.