Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Pick Object picking the wrong objects

Author
Message
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 27th Oct 2010 04:35
I've searched all over the forum and couldn't seem to find a solution.

Here is the code i'm using to pick an object from the screen.

selected = pick object(mousex(), mousey(), 2, 2)

Say I have a terrain object and a cube object behind that, when I click the terrain, it selects the cube, and when I click the cube it selects the terrain. Anyone know why it is doing this?
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 27th Oct 2010 08:40
It might be because your start object number and end object number is the same, meaning that the pick object function is only checking for one object. Try '1,2' and see if that works.

A clever person solves a problem, a wise person avoids it - Albert Einstein
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 27th Oct 2010 09:06
Ok, I tried a whole bunch of different numbers in there, none of them fixed it. I've decided to stick with 1, 10000 for now, just to make sure it can pick from a wide range of objects. I'm still getting the same problem though, and some objects I can't pick at all.
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 28th Oct 2010 10:24
Would you be able to post some more code?

A clever person solves a problem, a wise person avoids it - Albert Einstein
Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 29th Oct 2010 04:42
I don't understand... This command will always pick the visible object and the specified screen coordinates.

OldPMan
TGC Store Seller
16
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 29th Oct 2010 11:39
you anywhere else in the code do not use mousex() and mousey()?

.....already beside..... for all
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 2nd Nov 2010 07:08
Sure. Here is the code I was testing with:



I seem to have discovered something that may help though. When I leave the autocam on, it works fine, but when I turn it off, the pick object command suddenly ceases to work. Anyone know why this is? I would rather not use the autocam...
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 2nd Nov 2010 07:47
It works perfectly for me What version of DBPro are you running?

A clever person solves a problem, a wise person avoids it - Albert Einstein
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 2nd Nov 2010 08:03
No idea. I just re-downloaded it recently from my online orders thing. I guess that's rather outdated then since I bought it back in 2006 haha. Ok I have version 7.5 now and it works fine. Thanks.

Login to post a reply

Server time is: 2024-11-23 07:47:09
Your offset time is: 2024-11-23 07:47:09