Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- I personally think the variables should be local since you might be using this in a coroutine or in some other weird multitasking scope
- local corner1 = Vector3.new(-12, -12, -12) -- corner1 of the cuboid
- -- corner1 < corner2 in EVERY ordinate or it won't work!
- local corner2 = Vector3.new(12, 12, 12) -- corner2 of the cuboid
- local checkme = Vector3.new(0, 0, 0) --coordinate we want to check
- local d = corner2 - corner1
- local c = corner2 - checkme
- if d.x >= c.x and d.y >= c.y and d.z >= c.z then
- --it's true, the object is in the cuboid
- end
Advertisement
Add Comment
Please, Sign In to add comment