I'm finding that I'm using _PhysicsProcess() in multiple scripts as I write logic for the enemies in my game. It just feels like this is probably not the way to do this. Any tutorials someone could point me to on the topic? I've only seen really beginner level videos so far, beginner to the extent that they pretty much through everything into one script.
#Using _PhysicsProces() in multiple scripts
1 messages · Page 1 of 1 (latest)
i see no issue with using PhysicsProcess in multiple scripts, unless you're running into problems like code duplication or, even worse, the execution order of the functions within a frame mattering
Great! It just felt like there should be a more elegant way to accomplish it. The game isn't big yet, so I'll find out as I go.
well if it's logic that needs to run every physics frame, there's no solution more elegant than that
what you can analyse about your code is whether parts of it are necessary to run every frame, or if they can be isolated into more particular functions to be called with signals or by other objects
I'm trying to avoid TOO much refactoring later. So I'm being careful at the onset.