This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

i have a lot of objects and a tile, all of them have an array called "tags"

when colliding, i want to see if the tags of the objects share a tag with the tile

how can i do this without using a for loop, as i feel as it would cause the game to slow down due to the amount of objects being checked

Godot version 3.4.4
in Engine by (112 points)

1 Answer

0 votes

Start with a for loop with a comparison to see if that effects performance as badly as you assume.

If a for loop isnt efficient enough, then you can try two simple changes to see if that improves your game.

  1. Implementing your tags with integers.
  2. Utilizing masks and layers if your objects are CollisionObjects
by (94 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.