Is there a way to detect exact position of collision between area and body ?

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

I am far too deep using area as a scripted manager of its collisions. At some point I want this area with big rectangular shape to detect collision with another big rectangular shape of rigidbody, and I want to get this position where they clashed in first moment of collision. I can see RigidBody has some options like DirectBodySTate, and I could eventually shift responsibilities of detection to the rigidbody. However this would be a lot of pain and I find it hard to believe, that Area has no option of doing the same, since it has all the same signals anyway.
Anybody tried anything ?

Use Raycast . Raycast collision point

ramazan | 2021-10-26 19:23

raycast won’t do. It is about collision of two shapes coming at different directions with different angles. Unless You have an idea how to implement raycast for this ? I am afraid it must be some kind of space query. For now i settled for custom AABB intersection, nut it is very inaccurate. Tried calling physics server for body direct state, but it crashes the engine, I guess thats what happens when direct state is called outside of process()

Inces | 2021-10-26 19:53

Add raycast to area. When there is a collision, let the raycast be activated and turn towards the body. then get the collision point. Just an idea . ( Google translate)

ramazan | 2021-10-26 20:02

Reddit - Dive into anything

ramazan | 2021-10-30 21:01

1 Like