godotengine / godotengine/godot-docs

When can the physics space be locked?

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

Description

**Your Godot version:**

4.1.1

**Issue description:**

Tutorial page about Ray-casting says this:

_"Godot physics runs by default in the same thread as game logic, but may be set to run on a separate thread to work more efficiently. Due to this, the only time accessing space is safe is during the `Node._physics_process()` callback. Accessing it from outside this function may result in an error due to space being locked"_.

I think it would be best if there was some clarification about what exactly causes this lock and what's the best way to use ray-casting outside of `physics_process`.

**URL to the documentation page:**

https://docs.godotengine.org/en/stable/tutorials/physics/ray-casting.html

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.