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 would love to help contribute a toggleable follow camera option (like mario / uncharted) - when the player does not provide look direction input for X seconds, the camera autofollows the player direction. I have implemented this in a separate project, but would like to know if there is a preferred way you would like me to approach this for this project.
General approach in my other project:
visible variable follow_camera, default to false on CameraController
mouse_has_not_been_touched variable, set to false
Timer on camera controller, set to 2 seconds, on timeout, sets mouse_has_not_been_touched to true
when mouse input is detected sets mouse_has_not_been_touched to false and starts the timer
In player script, when follow camera is on and _camera_controler.mouse_has_not_been_touched and player is_moving, (not aiming), have the camera follow the player.
Please let me know objections/considerations.
The text was updated successfully, but these errors were encountered:
Hi, thanks for your interest in contributing to the project! And sorry for the reply delay; we have lots on our plates.
For the implementation, I'd go with either a steering equation (vector calculations) or using spherical-lerp with quaternions perhaps. This would make the code a bit simpler to read and edit.
If you use a timer to check for input, I wouldn't also have a boolean to check if the mouse has been touched. You could instead check if the timer is running or not. I don't have all the code in mind for this project, but I'd also ideally keep the camera code in the CameraController script over splitting logic between the camera and player controller scripts.
Let me know if you have any questions. Don't hesitate to open a PR directly with the change, and if it's okay with you, I could directly edit the code and comment where I'd make changes. That's how we usually do reviews in our team. A little extra note: please use snake case and no abbreviations in variable or function names.
I would love to help contribute a toggleable follow camera option (like mario / uncharted) - when the player does not provide look direction input for X seconds, the camera autofollows the player direction. I have implemented this in a separate project, but would like to know if there is a preferred way you would like me to approach this for this project.
General approach in my other project:
In player script, when follow camera is on and _camera_controler.mouse_has_not_been_touched and player is_moving, (not aiming), have the camera follow the player.
Please let me know objections/considerations.
The text was updated successfully, but these errors were encountered: