#in this case the object's local position is x=0 y=0. so even tho its parent was moved it still thinks it's at 0/0 (top left corner)
Explore tagged Tumblr posts
Note
You're more amazing than making a game
Sutures are working great 👍
#asks#trauma center recreation#jk i already fixed the bug#i just saved this video specifically the reply to today's ask because it's a funny bug#explanation: i was using line intersection checks which isn't a default Thing like normal collision#you have to manually enter the start and end points of each line#no problem. i'll just grab the coordinates.#problem: when you grab an object's coordinates it gives you its LOCAL coordinates#so if the object's parent was moved (thus moving the object) the object's coordinates don't reflect that movement#in this case the object's local position is x=0 y=0. so even tho its parent was moved it still thinks it's at 0/0 (top left corner)#thus the only way to suture it is to suture the top left corner#EXCEPT there's OTHER code that uses normal collision to find what lines to check. and the normal collision works normally#so i have to put a thread over the normal collision to make it see the laceration and then put a thread over the line at 0/0 to suture it#anyway it's an easy fix: there's a global_position variable that stores exactly what it sounds like#so just subtract the local position from that and then add the result to each of the coordinates#so it's working now. yay :D#also you can see the sutures going underneath the wound. fixed that too. it's all working now
5 notes
·
View notes