Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
9697ab1216 | |||
eee59dfa6a | |||
3c0c6ce9c0 | |||
61922a1b52 | |||
|
8897be3be1 | ||
af8f505fcc | |||
4276bf20c5 | |||
f4ec2bf05d | |||
|
a41f5afb4f | ||
|
e5cfe86cb5 |
21
LICENSE.md
Normal file
21
LICENSE.md
Normal 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.
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
@@ -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]
|
||||
|
@@ -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]
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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"))
|
||||
{
|
||||
|
Reference in New Issue
Block a user