godotengine / godotengine/godot-docs
Documentation for Skewed CollisionShape2D not being supported for collision checking
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
I was trying to get collisions to work properly with a skewed CollisionShape2D on a ShapeCast2D but couldn't figure out why for a long time. It's entirely possible I missed documentation about Non-uniform scaling of PhysicsBody2D or CollisionShape2D being unsupported but thought it would be helpful to have documentation on it.
The problem I was experiencing was this https://youtu.be/1n7NIWX4XL4 but it sounds like this is a known limitation with CollisionShape2D collisions. Essentially if you skew the ShapeCast2D node 30 degrees and add a rectangle shape, then it's collisions with other skewed CollisionShape2Ds fail to collide at the proper contact points (the collision point seems like it stretches about 30% out from the visual debug collision shape bounds if you move in from the sides of the shapes instead of at the corners)
Should a note be added about this to [Shape2D](https://docs.godotengine.org/en/stable/classes/class_shape2d.html#class-shape2d), [CollisionShape2D](https://docs.godotengine.org/en/stable/classes/class_collisionshape2d.html), or [PhysicsBody2D](https://docs.godotengine.org/en/stable/classes/class_physicsbody2d.html)?
> > For what its worth, I've also notice that skewing the circular collider to match the skew of the isometric tile also give strange results.
> > Isometric TileMap with skewed circular collider:
>
> Non-uniform scaling of PhysicsBodies or collision shapes is not supported. Use a polygon collider to create a squished circle instead.
_Originally posted by @Calinou in https://github.com/godotengine/godot/issues/75324#issuecomment-1484163865_
Demo Project
[SkewedCollisionShape2DTest_Godot_4.2.1.zip](https://github.com/godotengine/godot-docs/files/13926610/SkewedCollisionShape2DTest_Godot_4.2.1.zip)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.