It’s about raw speed processing physics, in a groupe. You are comparing strings.And each letter “Myreadball” is a comparison of 11 checks if its maped. Then you do a calculation to get a result then a comparison on the result more computations. On a small project not a problem. But if you have thousands of complex physics running that would be booged down in other computational cycles that could be used in runing your games more smoothly. My method would just compare the number one step raw speed. If you use a switch case I bleave that uses hashing so no comparison just execute the correct cycle I’ll put up a speed comparison video later as I would like to test it out my self.
Have a great day.
Small edit: meant to say you can use it in tandem with groups, like put things in to groups then use it as powerup up or something else for all enemy in that group with less than 50% power.
yeah that was what I was doing I was setting the layer of 32
func _on_head_body_entered(body: Node3D) → void:
if body.collision_layer > 2000000000: #Is it an Interactable Object Layer 32
if body.ID == GlobaVar.Ladder : #Object Layers must have script
LadderTop = true
hehe,
Done that to stop the crashing just encase no script or that variable dose not exists on an object
but its more instructions to check slowing things down just because a variable don’t exist.
But its cool the engine is so easy to compile and mod.
Now I have a simple int I can store anything in it use it for Health or test for object’s, etc
So I can just do a enum {Ladder,Box,Player} now don’t need to worry about other checks
if node.tag == Ladder // or 0
if node.tag == Box // or 1
if node.tag == Player // or 2
no scripts or extra steps
or I can even use it as a with groups get all the enemy’s with lest than 50% power and do something
Yes I can do it in script but not everything needs a scrip for just a simple number. because I having to write a script with one line of code for like a ladder that just says var ID = 1 or something
But its ok it wont interfere with using groups they very fast with the hashing algorithm its an optional extra that I’m use to.