0 votes

Hi,

My player object (ball) is a RigidBody2D with regular circle CollisionShape2D.

How can I detect, when the player is pressed from 2 (or more) sides?
The simple collision detection (or raycasting) is not enough for me, because I want to detect that a moving (ie, falling or animated RigidBody2D) object is trying to "squeeze" the player.

Some possible cases:
1.)
enter image description here

2.)
enter image description here

3.)
enter image description here

What is the best way to achieve this?
Is there a general solution, which works for any collider types and any collision angle?

(Windows 10, Godot 2.1.5 x64)

Thank you!

in Engine by (674 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.