An Unusual Problem

the tutorial is “Make an FPS in godot 4” by Stayathomedev

Well this is weird then

Also can u put a csgbox3d in ur level scene and see if it shows up, just to confirm it’s a global issue

I tried that and it didn’t show up

OK i have no idea how or why it’s happening then lol

When did this issue start? if it was recent maybe try undoing some stuff

The really weird thing to me is that i’ve looked at the comments on the tutorial video and nobody has really had this issue, so i think either its a bug or u mightve accidentally clicked something idk

If u can’t think of anything i suggest starting a new project with the same or different tutorial or smth

well today it started when someone else was helping me fix another issue with the same toturial and it showed up after he had helped me fix that issue, but thanks for trying to help lol

wait was it on godot forums i can take a look at it maybe

Well i found the post ur talking about, imma take a look at his code maybe the problem is there
So u say it started when u got the camera to move around?

That’s alot of code to move the camera and stuff. How about u make a new player character like this:

Then add a new script to the player
image
image

And use this code:

extends CharacterBody3D


const SPEED = 5.0
const JUMP_VELOCITY = 4.5

const SENS : float = 0.001

func _input(event):
	if event is InputEventMouseMotion:
		
		if Input.mouse_mode != Input.MOUSE_MODE_CAPTURED: return
		%Head.rotate_y(-event.relative.x * SENS)
		%Camera3D.rotate_x(-event.relative.y * SENS)
		%Camera3D.rotation.x = clampf(%Camera3D.rotation.x, -PI/2.0, PI/2.0)

func _physics_process(delta):
	# Add the gravity.
	if not is_on_floor():
		velocity += get_gravity() * delta

	# Handle jump.
	if Input.is_action_just_pressed("ui_accept") and is_on_floor():
		velocity.y = JUMP_VELOCITY

	# Get the input direction and handle the movement/deceleration.
	# As good practice, you should replace UI actions with custom gameplay actions.
	var input_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
	var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
	if direction:
		velocity.x = direction.x * SPEED
		velocity.z = direction.z * SPEED
	else:
		velocity.x = move_toward(velocity.x, 0, SPEED)
		velocity.z = move_toward(velocity.z, 0, SPEED)

	move_and_slide()

Also use Access as Unique Name for easy referencing (on head and camera)
image

sorry I didn’t reply to your other replies, I was eating lunch. I will get back to you once I get that done.

When I run it, it crashes and gives me this error, idk what it means. I probably is just my fault.


Click the + in the top right to make a new scene


Click other node, choose characterbody3d

Then u add these nodes

U set collision shape to a Capsule
image

Then u add the script to the player and also do the unique names thing for the Head and Camera3D

When ur done send a screenshot of the scene so i can check if its correct

ok I will reply once I finish that

Is this correct, proably not, it crashes when i run it

As the error says u put a characterbody scipt on some mesh instance, try clicking on the error to find the node and then remove the script from it

I fixed it, but when i run it its grey

you need to put the player into ur level scene

also i can see that u didnt do access as unique name on the camera

can u screenshot the level scene rq