I have a Character controller and I’m using Move() to move the character around in the world. Documentation online says “A collision constrains the Move from taking place.” which is not enough for me to understand what’s actually going on. If I’m the blue blob commanding a move to the green outline, do I end up at yellow, at orange, in between, do I not move at all?
My guess is that it’ll stop as soon as it reach any collision minus skin width, basically the yellow. But then there is also slope limit. Does it move to the closest point it can between the goal and itself within the bounds of slope limit? I can’t find if there is somewhere to view the Move() function all coded out
I wonder why you don’t just try it yourself to see what happen?
You’ll end up at the orange position. If you then will move the controller to Vector3.down it won’t move, because there’s a collision below. If you move it further right, the collision below will affect the actual velocity and will change your position.y, but on x and z you’ll be able to reach the desired target position values.
As far as I know the below collision has higher priority, so if you move uphill on diagonal, you’ll as well end up at the orange, because despite there would be a collision on the z or x axes as well, the y axis collision will be evaluated first, and after that the x and z collisions won’t affect the resulting velocity.
If it detects that the below collision angle is higher than the slopeLimit, it won’t move uphill, in this case the y position won’t be adjusted, but you will be able to move along the slope area border at x and z axes.
I found it goes to the closest point on the to the desired location on the slope, ie between orange and yellow on the original picture.
If you are on a 30 deg slope and move into the slope 10 units you’ll find yourself 10cos(30) units up the slope. Even if you are standing towards the end of the slope and it is less than that 10cos(30) distance to the end, you’ll still end up floating in air 10*cos(30)sin(30) up and 10cos(30)*cos(30) out. Maybe it calculates the position based on the normal and just sends you to that position.