Bug Fixed - Trees collision not working well


ENGLISH

There was a bug with Parallax2D and trees that caused the collision of some trees to not work correctly, even though they were there.

This happens due to the use of Parallax2D with colliding objects, so the best solution was to move the trees out of this Node.

Now there is a scene called “collision_object” inside Maps/Collision, which is a StaticBody2D that contains a Timer and a Node that detects when it is visible by the player and when it stops being visible, this way when this object stops being on screen the Timer is activated (5 seconds), if this is completed then the object is repositioned around the player, if the object re-enters the screen before the Timer is completed then it stops.

With this you just have to create a new scene that inherits “collision_object”, as is the case with “tree”. Once you have it ready, add several in the new Node “DecoCollisionContainer” inside the map for a better organization.

ESPAÑOL

Había un error con Parallax2D y los árboles que causaba que la colisión de algunos árboles no funcionara correctamente, aunque estuvieran allí.

Esto ocurre debido al uso de Parallax2D con objetos que colisionan, así que la mejor solución fue mover los árboles fuera de este Nodo.

Ahora hay una escena llamada "collision_object" dentro de Maps/Collision, que es un StaticBody2D que contiene un Timer y un Node que detecta cuando es visible por el jugador y cuando deja de serlo, de esta forma cuando este objeto deja de estar en pantalla se activa el Timer (5 segundos), si este se completa entonces el objeto se reposiciona alrededor del jugador, si el objeto vuelve a entrar en pantalla antes de que el Timer se complete entonces se detiene.

Con esto solo tienes que crear una nueva escena que herede "collision_object", como es el caso de "tree". Una vez lo tengas listo, añade varios en el nuevo Nodo "DecoCollisionContainer" dentro del mapa para una mejor organización.

Files

game.zip Play in browser
68 days ago
VampireSurvivorsTemplate.zip 2.1 MB
68 days ago

Get Vampire Survivors Template

Buy Now$3.99 USD or more

Leave a comment

Log in with itch.io to leave a comment.