Post by codeassembler on Feb 18, 2017 10:39:17 GMT
Hi all, hope everything is great with your projects!
I'm working out a SideController, when the character is in front of any obstacle it detects the slope on it as it normally does (to check if it can climb on it or not), then if the resulting slope is at a higher angle than "Slope Limit" value at vThirdPersonController Inspector, then the character stops at it should. However, the problem is when the obstacle is small and the Character should be able to jump over it by means of "Jump Air Control".
He just can't. I mean, if I know in advanced the character will get stuck I can jump over before the character reach the small object and it will be able to jump over it and be influenced by "Jump Air Control / Jump Forward" parameter, but otherwise I let him reach the obstacle he will just issue the StopMove() if the obstacle Slope is high enough, even when the obstacle is small enough to overcome with a jump with "Jump Air Control / Jump Forward" speed.
This does not happens with all the obstacles. Of course if the small obstacle does not pose a Slope higher than "Slope Limit" then you can jump over it after reaching it, since the StopMove() function will not trigger in response to "Slope Limit" then.
To try put it even simpler: if you try jumping over a small triangle above the floor and the slope is 45 degrees or less /\ and you have set the "Slope Limit" to 50 you can safely touch any of its sides with the character and stop right there. Then you press jump and move over it while jumping and you'll be able to jump over it by means of "Jump Air Control". However, if instead of a small triangle above the ground you have a small Cube [] and you touch it with the character then the character will stop moving and if you jump it will only let you jump upwards, you can not jump over, since it will not let you use "Jump Air Control" because the side of a cube Slope will be lot higher than "Slope Limit". Of course you'll be able to jump if you go far enough, pickup speed and then jump over it, but forcing a player to do that will be very frustrating in an actual game! lol
Which would be the best way to "fix" this behaviour for the SideController ?
I'm working out a SideController, when the character is in front of any obstacle it detects the slope on it as it normally does (to check if it can climb on it or not), then if the resulting slope is at a higher angle than "Slope Limit" value at vThirdPersonController Inspector, then the character stops at it should. However, the problem is when the obstacle is small and the Character should be able to jump over it by means of "Jump Air Control".
He just can't. I mean, if I know in advanced the character will get stuck I can jump over before the character reach the small object and it will be able to jump over it and be influenced by "Jump Air Control / Jump Forward" parameter, but otherwise I let him reach the obstacle he will just issue the StopMove() if the obstacle Slope is high enough, even when the obstacle is small enough to overcome with a jump with "Jump Air Control / Jump Forward" speed.
This does not happens with all the obstacles. Of course if the small obstacle does not pose a Slope higher than "Slope Limit" then you can jump over it after reaching it, since the StopMove() function will not trigger in response to "Slope Limit" then.
To try put it even simpler: if you try jumping over a small triangle above the floor and the slope is 45 degrees or less /\ and you have set the "Slope Limit" to 50 you can safely touch any of its sides with the character and stop right there. Then you press jump and move over it while jumping and you'll be able to jump over it by means of "Jump Air Control". However, if instead of a small triangle above the ground you have a small Cube [] and you touch it with the character then the character will stop moving and if you jump it will only let you jump upwards, you can not jump over, since it will not let you use "Jump Air Control" because the side of a cube Slope will be lot higher than "Slope Limit". Of course you'll be able to jump if you go far enough, pickup speed and then jump over it, but forcing a player to do that will be very frustrating in an actual game! lol
Which would be the best way to "fix" this behaviour for the SideController ?