Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Nighteyes |
I’m having problems with collisions when the Area2D node is scaled to accommodate for the shape of a elongated “shield” and “projectile”. Meaning the sphere has not a radius of one.
On the side where the shield is thinnest the collisions happen way too soon. If I change the scale back to make a uniform sphere the collisions are correct. Is this a bug or expected behaviour?
Two times the following node setups
Area2d with childs:
- Sprite
- CollisionShape2D (Sphere)
To make sure everything was setup correctly I ran my game with visible collision shapes (–debug-collisions). See screenshot included where a breakpoint is triggered at moment of “impact”.
English is not my native language and I wasn’t sure how to describe a sphere that is not perfectly round in geometrical terms.
I did not find any similar problems while searching.
Setup is:
Windows 10, Rider with C#
I could try it out tomorrow in Linux. However I don’t think that will change the outcome.
This question can be closed.
I got my answer filing a bug report at github. For future reference. Area2D does not support scaling, especially not when done in a non-uniform manner.
A possible work around is using CollisionPolygons (and in my case generating them at runtime).