Ai collision problem of CharacterBody2D's

Godot Version

v4.2.2

Question

I am making a game with the same game mechanics as a game called alien transporter for my first game, (https://www.youtube.com/watch?v=1U6z2BoQMGs) (if you don’t trust the link just look it up, it’s the 2D cartoony one)

I have the basic controls down and the passengers will walk up to the ship if it is within a certain range of it, and once both the CharacterBody2D’s Area2D’s collide he will enter the ship if possible.

I’m into the issue if I land on top of the passenger, half the time it won’t work and he won’t enter the ship, or it will work but he still appears to be in his spawn location.

If you have any clarifying questions, feel free to ask sense I’m not the best at explaining things.

More info:
(I’m using Area2D’s and moving them to allow the passengers to board the ship if they’re colliding)
( Instead of making the passengers spawn and despawn I’m just moving them off and on screen)

i think its better to remove them from the scene-tree:

passengers.append(passenger)
remove_child(passenger)

But keep them stored somewhere to avoid memory loss

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.