Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Tweeted twitter.com/StackGameDev/status/698164171553312768
added 3 characters in body
Source Link
jzx
  • 3.8k
  • 2
  • 26
  • 38

When I go down slopes with character controller, if the speed is too high, the character just flies off the slope and lands at the bottom. I want my character to "stick" to the slope rather then just jump of it. I came up with code to do so, but it didn't turn out as I planned. Now the character just slides on the slope when I stop pressing the arrows (not staying at its place on the slope).

Physics.Raycast (transform.position, Vector3.down, out hit);
 transform.position = transform.position
          
          transform.position =transform.position + new Vector3(0f, distance - hit.distance, 0f);

Thanks for the help, i couldn't figure this out all day.

When I go down slopes with character controller, if the speed is too high, the character just flies off the slope and lands at the bottom. I want my character to "stick" to the slope rather then just jump of it. I came up with code to do so, but it didn't turn out as I planned. Now the character just slides on the slope when I stop pressing the arrows (not staying at its place on the slope).

Physics.Raycast (transform.position, Vector3.down, out hit);
             
          transform.position =transform.position + new Vector3(0f,distance-hit.distance,0f);

Thanks for the help, i couldn't figure this out all day.

When I go down slopes with character controller, if the speed is too high, the character just flies off the slope and lands at the bottom. I want my character to "stick" to the slope rather then just jump of it. I came up with code to do so, but it didn't turn out as I planned. Now the character just slides on the slope when I stop pressing the arrows (not staying at its place on the slope).

Physics.Raycast (transform.position, Vector3.down, out hit);
transform.position = transform.position
                     + new Vector3(0f, distance - hit.distance, 0f);

Thanks for the help, i couldn't figure this out all day.

When iI go down slopes with character controller, if the speed is too high, the character just flies ofoff the slope and lands at the bottom. I Wantwant my character to "stick" to the slope rather then just jump of it. iI came up with a code to do so, but it didntdidn't turn out as iI planned. nowNow the character just slides on the slope when iI stop pressing the arrows ( notnot staying at its place on the slope).

Physics.Raycast (transform.position, Vector3.down, out hit);
             
         transform.position =transform.position + new Vector3(0f,distance-hit.distance,0f);

Thanks for the help, i couldn't figure this out all day.

When i go down slopes with character controller if the speed is too high the character just flies of the slope and lands at the bottom. I Want my character to "stick" to the slope rather then just jump of it. i came up with a code to do so but it didnt turn out as i planned. now the character just slides on the slope when i stop pressing the arrows ( not staying at its place on the slope).

Physics.Raycast (transform.position, Vector3.down, out hit);
             
         transform.position =transform.position + new Vector3(0f,distance-hit.distance,0f);

Thanks for the help, i couldn't figure this out all day.

When I go down slopes with character controller, if the speed is too high, the character just flies off the slope and lands at the bottom. I want my character to "stick" to the slope rather then just jump of it. I came up with code to do so, but it didn't turn out as I planned. Now the character just slides on the slope when I stop pressing the arrows (not staying at its place on the slope).

Physics.Raycast (transform.position, Vector3.down, out hit);
             
         transform.position =transform.position + new Vector3(0f,distance-hit.distance,0f);

Thanks for the help, i couldn't figure this out all day.

Source Link

Character controller going down slopes

When i go down slopes with character controller if the speed is too high the character just flies of the slope and lands at the bottom. I Want my character to "stick" to the slope rather then just jump of it. i came up with a code to do so but it didnt turn out as i planned. now the character just slides on the slope when i stop pressing the arrows ( not staying at its place on the slope).

Physics.Raycast (transform.position, Vector3.down, out hit);
             
         transform.position =transform.position + new Vector3(0f,distance-hit.distance,0f);

Thanks for the help, i couldn't figure this out all day.