CameraPitch and CameraYaw don't allow passing a Camera3D as ref
leftbones opened this issue · comments
Issue description
Since the built-in first person camera doesn't let you easily change things like speed, I was implementing it myself. I got movement working but when trying to implement camera rotation with the mouse, I found that CameraPitch()
and CameraYaw()
both require Camera3D*
but attempting to pass in my Camera3D using ref
gives the error:
Argument 1 may not be passed with the 'ref' keyword
Attempting to pass in the Camera normally (not ref) gives the error:
Argument 1: cannot convert from 'Raylib_cs.Camera3D' to 'Raylib_cs.Camera3D*'
So it appears there is no winning.
Environment
- Windows 11
- Raylib-cs 5.0.0
- .NET 7.0.401
My game so far is a pretty barebones FPS, following the examples pretty closely. The only real difference is my Camera3D is stored as a property of the Player class. I'm not using any UpdateCamera
or UpdateCameraPro
methods, I'm performing my own movement calculations and applying them directly to Camera.position
and Camera.target
, which is working out fine.
Using UpdateCamera
with the default first person camera stuff would be ideal, but I needed to be able to control the speed of the camera, which doesn't seem possible.
Can you pls show us your code?
So whats the problem?
Properties are not compatible with ref, thats basic C#.
@ChrisDill this issue could get closed.