How to push KinematicBodies 3D

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

Is there an efficient way to push kinematic bodies in 3D? For example an area node pushing away all kinematic bodies within the area?

Add script to “KinematicBody” and

Area has a push and pull feature, but it seems to only work on “RigidBody”.

ramazan | 2022-02-08 08:17

:bust_in_silhouette: Reply From: SteveSmith

As the commenter said, us move_and_slide(). If you want the area to push them away, subtract the translation of the centre of the area from the body’s translation, and then normalise it to get the direction.