Why is physics process(_delta). So not delta for enemies. Also

Hello im a newbie just wanted a quick answer as im trying to full flesh out and learn concepts. Extra - is direction.to just another way of saying enemy global minus direction.to until player pos?

yes i think so if i understand you correctly.

vectorA.direction_to(vectorB)

is the same as

(vectorB - vectorA).normalized()

Can you explain more clearly what the title is supposed to ask?

I Watched a tutorial for enemy movement, and they made physics process(delta) With a _ instead of just delta. Why is that?

you usually use a underscore(_) on variables you dont use inside the method, so the compiler wont complain about them. If you use delta for player movement you should also use it for enemy movement

You use delta for both but for enemys that track you they used _delta

its just a different name for the same variable. He probably had it as “_delta” and forgot to change it back to “delta”.
This doesnt matter as long as you use the same name consistently inside the method.

(If you want you can also call it “elephant”, for whatever reason)

I did not know that man thx appreciate it!

1 Like

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