I want to control the physics of an actor with custom logic that reacts to its surroundings. Basically, the actor ought to avoid the ground and walls and adjust its velocity and rotation.
I am currently solving this by calculating the distance with rays and applying a respective force and/or rotation each frame. However, this only works if a constant high framerate is provided. With a low framerate, the actor may move too far between frames making it unable to adjust. See this illustration for clarification.
Is there a way to get a more deterministic behavior? I have thought of two possible solutions - one would be to stop using the built in physics (velocity) and setting the position and rotation manually, with substepped logic - the other one would be to try to react to collisions and guess how the actor should have acted in the first place. Both don’t sound perfect by all means, so I’m hoping for an existing better solution.