godotengine / godotengine/godot-docs

Absent mouselook information

Open
#6,425 2 comments 0 reactions 0 assignees View on GitHub
area:manual discussion enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

Hello, I'll try to be short and direct. What do you need to make a First Person Shooter? Mouse look. What is not present at GODOT docs? Mouse look.

https://docs.godotengine.org/pt_BR/stable/tutorials/inputs/mouse_and_input_coordinates.html

This page and nothing is the same thing. acomplishes nothing.
The VOXEL 3d tutorial actually helps with mouse look. On the player script:

func ready():
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

func _process(_delta):
# Mouse movement.
_mouse_motion.y = clamp(_mouse_motion.y, -1550, 1550)
transform.basis = Basis(Vector3(0, _mouse_motion.x * -0.001, 0))
head.transform.basis = Basis(Vector3(_mouse_motion.y * -0.001, 0, 0))

func _input(event):
if event is InputEventMouseMotion:
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
_mouse_motion += event.relative

Explanation:
the ready function captures the mouse movement.
The process function match the head(or camera) movement with the horizontal and vertical of the mouse.
The input event function transfer the relative mouse movement every frame into a Vector to guide the camera.

Thats it. Thank you for your time. I hope this helps someone. God bless

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the referenced mouse and input coordinates page and compare it with the mouse-look example included in the issue. The documentation work is done when the relevant tutorial gives newcomers actionable mouse-look guidance, including the capture, movement, and input handling concepts described here.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, game-dev
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.