10 Commits
1.0 ... 1.2

Author SHA1 Message Date
9697ab1216 jitterfix 0.5f faster 2023-01-06 16:53:45 +01:00
eee59dfa6a custom actual working jitterfix 2023-01-06 16:49:36 +01:00
3c0c6ce9c0 Merge branch 'master' of https://github.com/vaporvee/gd-mono-thirdpersoncontroller 2023-01-06 16:22:37 +01:00
61922a1b52 changed max fps like less physics simulations 2023-01-06 15:25:40 +01:00
Yannik
8897be3be1 Create LICENSE.md 2023-01-06 01:53:15 +01:00
af8f505fcc adjusted mousepitch clamp 2023-01-04 20:26:06 +01:00
4276bf20c5 Merge branch 'master' of https://github.com/vaporvee/gd-mono-thirdpersoncontroller 2023-01-04 20:24:55 +01:00
f4ec2bf05d renamed icon 2023-01-04 20:24:49 +01:00
Yannik
a41f5afb4f Update readme.md 2023-01-03 20:21:03 +01:00
Yannik
e5cfe86cb5 Update readme.md 2023-01-03 20:13:11 +01:00
7 changed files with 43 additions and 15 deletions

21
LICENSE.md Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 vaporvee
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

View File

@@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://nqd2l5xjbwh1"
path="res://.godot/imported/gd-mono-thirdpersoncontroller.png-1aea9d41ab1691227a784d4d60205324.ctex"
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gd-mono-thirdpersoncontroller.png"
dest_files=["res://.godot/imported/gd-mono-thirdpersoncontroller.png-1aea9d41ab1691227a784d4d60205324.ctex"]
source_file="res://icon.png"
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
[params]

View File

@@ -13,9 +13,8 @@ config_version=5
config/name="Godot Mono thirdperson controller"
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.0", "Forward Plus")
run/max_fps=144
boot_splash/show_image=false
config/icon="res://gd-mono-thirdpersoncontroller.png"
config/icon="res://icon.png"
[autoload]
@@ -72,7 +71,6 @@ uncapture_mouse={
[physics]
common/physics_ticks_per_second=144
3d/default_gravity=12.0
[rendering]

View File

@@ -1,3 +1,5 @@
# Godot Mono thirdperson controller
This is a working thirdperson controller made in the mono version of godot with C# <br>
Currently running in Godot 4 beta 10
Currently running in Godot 4 beta 10<br>
<br>
Demo video: https://www.youtube.com/watch?v=qTzU90Vj3Nw

View File

@@ -6,8 +6,8 @@ public partial class player : CharacterBody3D
[Export] float jumpVelocity = 5f;
[Export] float gravity = 14f;
[Export(PropertyHint.Range, "0.1,1.0")] float mouseSensitivity = 0.3f;
[Export(PropertyHint.Range, "-90,0,1")] float minMousePitch = -90f;
[Export(PropertyHint.Range, "0,90,1")] float maxMousePitch = 90f;
[Export(PropertyHint.Range, "-90,0,1")] float minMousePitch = -50f;
[Export(PropertyHint.Range, "0,90,1")] float maxMousePitch = 50f;
public override void _Process(double delta)
{

View File

@@ -3,12 +3,19 @@ using System;
public partial class window : Node
{
public override void _Ready()
{
ProjectSettings.SetSetting("physics/common/physics_ticks_per_second", Performance.GetMonitor(Performance.Monitor.TimeFps));
}
public override void _Process(double delta)
public override async void _Ready()
{
/* VSync should be used because needing to change the PhysicsTicksPerSecond in _Process takes CPU ussage
* You could also just set max FPS and delte this fix
*/
await ToSignal(GetTree().CreateTimer(1.5f), "timeout");//waits until the game has loaded some time
if (Engine.PhysicsTicksPerSecond != (int)Engine.GetFramesPerSecond())
{
Engine.PhysicsTicksPerSecond = (int)Engine.GetFramesPerSecond(); //PhysicsTicksPerSecond have to be the same value like current FPS or the movement will lagg
GD.Print("Set PhysicsTicksPerSecond to: " + Engine.PhysicsTicksPerSecond);
}
}
public override void _Process(double delta)
{
if (Input.IsActionJustPressed("fullscreen"))
{