0 votes

which on is more preferred if i have 1000 item that can be looted ?

using body entered signal OR the Item body is kinematicBody (Item is area 2D).

if i use kinematicBody(Item is area 2D) on all of the item and they all have script.. does performance of my game will be lagging ?

Godot version 3.2.1
in Engine by (69 points)

Not sure what you're asking. You should probably use Area2D if you want to pick up the item, i think you're asking if you should detect the items in the player script or the item script, and I think there wouldn't be much of a performance difference, because you're using area2d detection anyway.

2 Answers

+2 votes
Best answer

I think there won't be lagging because all the 1000 signals won't emit at the same time but if you instance all these in the editor then it might take long to read all the codes at the runtime.
But for more surity try not instance all the items and loots at the editor but instance them during runtime with codes.

func instance_item(which_one):
    var s = load("res://ItemsFolder" + which_one + ".tscn").instance()

Here just call this function with the item you want to instance and remember name of item should be similar to its scene's name
The way I told you earlier was devoloped by me. So that won't be much trustworthy but will still work fine :)

by (940 points)
selected by
+1 vote

It is totally upon you which way you prefer. details of both ways are with you.
In case something goes wrong then ask.

by (940 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.