Checking for objects right next to another object

About advanced scenes, and the Thyme scripting language used in Algodoo.

Checking for objects right next to another object

Postby BoxxedBread » Fri Nov 05, 2021 12:18 am

Been trying for a while now to figure out a way to find objects right next to another object. My current method right now is to create a box next to the object I'm testing with and listen for a collision, but this is inefficient due to how often I need to check, and unreliable because of the high movement speed it has. Is there another, more reliable way to do this?

Below is a visual representation of what happens when I check for objects using my method
Image
User avatar
BoxxedBread
 
Posts: 1
Joined: Sat Mar 24, 2018 6:13 am

Re: Checking for objects right next to another object

Postby UnityDogGaming04 » Sat Nov 06, 2021 9:49 pm

There's some code out there that indexes every single object in the scene, and adds the ones that fit a certain condition, at least if I recall correctly. I've never used it and I don't even know what it looks like for sure, but look through the forums for anything along the lines of (something here that means every object) {condition that each object must meet, like math.vec.dist(pos, e.pos) < 1}
ALL HAIL THYME!
UnityDogGaming04
 
Posts: 17
Joined: Tue Oct 05, 2021 8:35 pm
Location: Buckeye, AZ


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests

cron