Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor first-person controller script #7289

Merged
merged 4 commits into from
Jan 17, 2025
Merged

Refactor first-person controller script #7289

merged 4 commits into from
Jan 17, 2025

Conversation

marklundin
Copy link
Member

Refactors First Person Controller script to use initialize() instead of the constructor

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

@@ -942,7 +955,7 @@ class FirstPersonController extends Script {
* @range [0, 0.4]
*/
set gamePadDeadZoneLow(value) {
this._gamePadDeadZoneLow = value;
this._gamePadDeadZoneLow = value ?? this._gamePadDeadZoneLow;
if (this._gamePadInput) {
this._gamePadInput.deadZoneLow = value;
Copy link
Member Author

@marklundin marklundin Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're checking for nullish, should this not be this._gamePadInput.deadZoneLow = this._gamePadDeadZoneLow

@marklundin marklundin merged commit 6a06bd4 into main Jan 17, 2025
7 checks passed
@marklundin marklundin deleted the fix-fpc-initialize branch January 17, 2025 11:02
mvaligursky pushed a commit that referenced this pull request Jan 17, 2025
* Refactor first-person controller script

* Fixed camera init and collision and rigidibody init

* Refactor input classes to handle null values for enabled property

---------

Co-authored-by: KPal <[email protected]>
Co-authored-by: kpal81xd <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants