Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Can someone help me determine if a point is enclosed in a square?

Asked by
lolb3 0
9 years ago

isOnPoint=function(pos,point,dist) x,y=point.Size.x/2,point.Size.y/2 pox,poy=point.Position.x,point.Position.y px,py=pos.x,pos.y if x + pox - px >= x and x + pox + px <= x then if y + poy - py >= y and y + poy + py <= y then return true end end return false end

this is my function. my function doesnt work. its not erroring. the math is just off by a lot. I'm trying to find if my character is over a square point. Can anyone help me with this? I'm not looking for magnitude.

0
excuse the formatting. here's a pastebin. http://pastebin.com/REnyRxqy lolb3 0 — 9y

Answer this question