Deleted member 219079
D
Deleted member 219079
I have unit going to x+1.0, y+1.0 every 1/32 seconds (so the moving force is 1,1). Then it get's to a point where the next point would be unwalkable. So I wanna modify the force so that it bounces relative to the angle.
Here's how it works now; my moving force is 1,1 and it sees relative position 1,1 is taken, so it inverts the moving force to -1, -1.
But the thing is it doesn't take angle into account:
It goes the wrong line and doesn't bounce to the correct 0.something , -0.something.
The problem 1 is how could the system even know what kind of obstacle there is, unit, destrcutible or unpathable terrain?
The problem 2 is I have no idea on how to calculate it mathematically:
For example like unit moving force is 10, 10, it sees tree blocking it, which is centered at relative pos 12,11.
So I guess it is impossible?
Here's how it works now; my moving force is 1,1 and it sees relative position 1,1 is taken, so it inverts the moving force to -1, -1.
But the thing is it doesn't take angle into account:
It goes the wrong line and doesn't bounce to the correct 0.something , -0.something.
The problem 1 is how could the system even know what kind of obstacle there is, unit, destrcutible or unpathable terrain?
The problem 2 is I have no idea on how to calculate it mathematically:
For example like unit moving force is 10, 10, it sees tree blocking it, which is centered at relative pos 12,11.
So I guess it is impossible?