You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm making a FPS game and I try to implement shooting. So, I casting GetRayCollisionBox(), but ray it returns looking in the wrong place.
After playing with minimal reproduce example I find that bug appears only if DisableCursor() is written beforeUpdateCameraPro (or regular UpdateCamera).
If I print DisableCursor()afterUpdateCamera in the game cycle everything works normally. IDK may be it's a way how I should it, but it feels quite bad.
Environment
Arch Linux (PC)
raylib 5.5-1
GPU: RX 570
OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.3.3-arch1.2
Issue Screenshot
Here, I pointed on cube and clicked, than step back a little bit. (NOTE: you need to move to other angle, from default position ray is normal)
Try replacing the: // DisableCursor(); // BUG: IF IT'S HERE, EVERYTHING IS NORMAL with SetMousePosition(GetScreenWidth()/2, GetScreenHeight()/2); to see if it's that.
Okaaay, I tried this in my code and it's not worked, but in example it worked. So, it's probably my code problem.
Issue description
I'm making a FPS game and I try to implement shooting. So, I casting
GetRayCollisionBox()
, but ray it returns looking in the wrong place.After playing with minimal reproduce example I find that bug appears only if
DisableCursor()
is written beforeUpdateCameraPro
(or regularUpdateCamera
).If I print
DisableCursor()
afterUpdateCamera
in the game cycle everything works normally. IDK may be it's a way how I should it, but it feels quite bad.Environment
Issue Screenshot
Here, I pointed on cube and clicked, than step back a little bit. (NOTE: you need to move to other angle, from default position ray is normal)
![Image](https://private-user-images.githubusercontent.com/112097339/406669151-a42e4670-f949-495a-b6d8-d4faaadb6a32.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDAwMTQ0ODksIm5iZiI6MTc0MDAxNDE4OSwicGF0aCI6Ii8xMTIwOTczMzkvNDA2NjY5MTUxLWE0MmU0NjcwLWY5NDktNDk1YS1iNmQ4LWQ0ZmFhYWRiNmEzMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIyMFQwMTE2MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03OGM0Y2EwNjg2ODYxYjVmZTAyMGMxY2JjNzBkZDBjZjZjZTYwMmViYTMyYTg2MGI5MWMzZWU3ZDUzMWEyODAzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.PqQ8ddhrUuAR2Fw7Jnw90yCVWrn2bXmNfqvWURdHpl0)
Code Example
I modified this example:
https://www.raylib.com/examples/core/loader.html?name=core_3d_picking
Look for a comments with "BUG" note. Or just go to the beginning of game main cycle.
The text was updated successfully, but these errors were encountered: