Oval shaped CollisionShape2D = Weird behaviour

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Godot_Noob

Hi !
I would like to give to my little cell an oval shaped CollisionShape2D. To do that I created a CircleShape2D that I flattened thanks to GUI, doing this changed the y-term of the scale.
enter image description here

Problem is the weird behavior of two cells meeting each other. They don’t slide as they should, but are attract or repel…
Is this a known issue and is there a solution for oval shaped CollisionShape2D ?


I edit my question with the full answer, because it was given by hilfazer into an answer and a comment, not really useful to read.
So, you should not scale a CollisionShape2D, it creates weird behavior (see his first answer). To have an oval/ellipse CollisionShape2D seems not possible in Godot (see
https://forum.godotengine.org/15016/is-there-no-way-to-make-an-elliptical-collision-shape ), but you can use instead a CapsuleShape2D, what I did.
Voilà :wink:

:bust_in_silhouette: Reply From: hilfazer

If you changed scale of collision shape bad thing can happen

“Be careful to never scale your collision shapes in the editor. The “Scale” property in the Inspector should remain (1, 1). When changing sizing the collision shape, you should always use the size handles, not the Node2D scale handles. Scaling a shape can result in unexpected collision behavior.”

See my answer

Godot_Noob | 2018-05-21 19:02

:bust_in_silhouette: Reply From: Godot_Noob

Alright, I understand the problem of using Node2D scale handles. But how to make an oval so ? Because the CircleShape2D does not allow it.

IIRC oval (ellipse) collision shape is not possible due to algorithm Godot uses. I remember reading about it in docs but i can’t find it now.

Perhaps capsule shape can be good enough.
Also, check out this question:

hilfazer | 2018-05-22 14:30

Thanks hilfazer. I edit my question with answer to make it easily readable.

Godot_Noob | 2018-05-23 05:30