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.

DarkBASIC Professional Discussion / Another problem with pick object

Author
Message
Regnuar
17
Years of Service
User Offline
Joined: 25th Dec 2008
Location:
Posted: 22nd Feb 2010 18:08
Hey, i made this code to pick an object. but it doesn't work, every time the cursor is over player (not enemy) it prints the enemy name.



anyone got an idea how to get this work the right way?
HowDo
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 22nd Feb 2010 18:44
your code is saying if object 2 is on the screen make the object pick count start at object one and end at object one, this because the command object in screen(2) returns a one not the object number.

Dark Physics makes any hot drink go cold.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 22nd Feb 2010 19:06
I'm not 100% sure, but I think that all the "pick" stuff uses bounding boxes/spheres. I had a similar problem when I had an object with a lot of open space to it where there were no pollygons. When I tried to pick an object behind it, I got the one in front.

Also, if you have all your targets in a loop, you need to make sure you aren't getting the last one in the ray, but the closest. You may need to check by distance.

The fastest code is the code never written.
Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 22nd Feb 2010 21:06
Like HowDo said change it to this.


If it hasn't exploded yet, I haven't touched it.

Login to post a reply

Server time is: 2026-07-27 07:33:56
Your offset time is: 2026-07-27 07:33:56