Skip to content

Fix viewing angles for player's camera, change gitignore, initialize .NET project.#4

Open
dnesov wants to merge 4 commits intoSCP-Godot:mainfrom
dnesov:main
Open

Fix viewing angles for player's camera, change gitignore, initialize .NET project.#4
dnesov wants to merge 4 commits intoSCP-Godot:mainfrom
dnesov:main

Conversation

@dnesov
Copy link
Contributor

@dnesov dnesov commented Dec 12, 2022

Trivial fix that prohibits doing 360 spins with the camera, removed .vscode from .gitignore and initialized a .NET project.

@dnesov dnesov changed the title Fix viewing angles for player's camera, change gitignore. Fix viewing angles for player's camera, change gitignore, initialize .NET project. Dec 12, 2022
@dnesov dnesov self-assigned this Dec 12, 2022
Copy link
Collaborator

@rezbyte rezbyte left a comment

Choose a reason for hiding this comment

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

Looking good so far!
I've added my suggestions in the comments.

This error appears when opening the project:

E 0:00:00:0384   read_all_file_utf8: Cannot open file 'res://Source/SCPCB/TestAutoload.cs'.
  <C++ Error>      Condition "err != OK" is true. Returning: err
  <C++ Source>      modules/mono/utils/string_utils.cpp:152 @ read_all_file_utf8()

The fix is changing line 49 in project.godot to:
TestAutoload="*res://Source/SCPCB/Autoloads/TestAutoload.cs"


# VSCode
.vscode/*
.vscode/*/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.vscode/*/**
.vscode

Excluding a directory also excludes it's sub-directories.


direction += -cam_transform.basis.z * input_vector.y
direction += cam_transform.basis.x * input_vector.x
direction = cam_transform.basis * Vector3(input_vector.x, 0, input_vector.y)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
direction = cam_transform.basis * Vector3(input_vector.x, 0, input_vector.y)
direction = cam_transform.basis * Vector3(input_vector.x, 0.0, input_vector.y)

Two things I've picked up:

  1. Godot 4 is stricter with literal types, 0 is always an int and never a float.
  2. The player can't move when looking perfectly up or down.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Thanks for pointing out! I'm relatively new to GDScript, especially when it comes to the newer version (been using Godot with C# so far), so I can mess up things like that.
  2. I tried to figure this out but the code is pretty messy right now so I would much rather rewrite the entire class with the state pattern in mind while fixing this issue. Not sure if we should move to C# entirely at this point, as I've been trying out newer betas and it becomes more and more stable to be actually used more extensively.

Copy link
Collaborator

@rezbyte rezbyte left a comment

Choose a reason for hiding this comment

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

Well done! 🎆
Looks good to me.

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