View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005226||Multi Theft Auto : San Andreas||Client||public||2010-03-03 05:38||2018-09-03 18:00|
|Summary||0005226: getCursorPosition() 3D Positions Return Inaccurate, But Nearby Positions - Also Negative WorldZ|
From debugging, I've found that the getCursorPosition doesn't work right when coming to 3D positions. I've found that a lot of these coordinates are near-by, but are still inaccurate. WorldZ is also negative and goes who knows where.
onClientClick can be used as reference since it works properly. I've also found several oddities in the getCursorPosition code:
1.) The lua declare returns as a double.
|Steps To Reproduce|
If it helps, I'm in windowed mode, about to test in fullscreen.
|Tags||No tags attached.|
onClientCursorMove is also affected by the incorrect worldX, Y, Z params.
The difference between onClientClick and getCursorPosition/onClientCursorMove is that onClientClick performs an additional line of sight check before returning the world x,y,z (If you click on the sky all three give the same x,y,z values)
We could add a line of sight check into getCursorPosition/onClientCursorMove, but that would cause additional overhead, especially for onClientCursorMove which is always processed every frame. Or the wiki could be changed. Perhaps to include an example of how to use processLineOfSight() with getCursorPosition/onClientCursorMove
I experienced this very recently.
Added an "Issues" section to the wiki page for getCursorPosition()