godotengine / godotengine/godot-docs

Improve CollisionObject2D class doc

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

Description

**Issue with current doc**: `CollisionShape2D` class doc suggests to use `CollisionObject2D` APIs to handle collisions as `CollisionShape2D` node is only a editor helper node, but it lacks proper documentation like:
- what is a shape owner
- what is the purpose of shape owner as an intermediate between Object and it's collision shape
- what is a shape_id and shape_index and how both are different

As a result, when people come up with "How to create collision shapes from script" on Github and Godot Q&A, answers still revolve around using `CollisionShape2D`

**What should be added to doc**: The doc should contain the following visualization of how collision shapes are organized in an object along with answers to above questions.

```
PhysicsObject
|
-ShapeOwner0 -> Shape2D0, Shape2D1......Shape2DN
| Index(0) Index(1) Index(N)
|
-ShapeOwner1 -> Shape2D0, Shape2D1......Shape2DM
| Index(N+1) Index(N+2) Index(N+M+1)
|
-ShapeOwner2 -> ......
|
.
.
```
Note: Above visualization is my understanding from experimenting with the `shape_owner*` APIs, please correct if wrong.

[1]: https://docs.godotengine.org/en/3.2/classes/class_collisionobject2d.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.