Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | patrice |
In the documentation for KinematicBody2D, it says:
Kinematic bodies are special types of bodies that are meant to be user-controlled.
Which gave me pause when considering how to implement some characters in my game! I currently have a player character scene with a KinematicBody2D root node and was considering having a base “character” scene for all characters to inherit from (including the player character), to handle general path-finding movement (player character movement is primarily point and click right now, where there are several obstacles like counters, etc, to navigate around given a Navigation2D and a corresponding tile map. Actual movement done via move_and_slide right now).
The other characters in my game would mostly be customers of the simulated store that would likely path find to a designated waiting area, then leave and path find out once they are given their order by the player character.
With my initial thought of just having the same movement functions for the player and customer characters, the customer characters would inherit from the generic “character” scene and script and have that same KinematicBody2D root node, then further have something like an Area2D child node in order to detect player clicks / interaction (all other interactables have an Area2D base node).
Can someone elaborate more on the documentation and when to use KinematicBody2D? Would this specific use case make sense, or is there a better/simpler way?