Forum rules - please read before posting.

Walk up and down any slope angle?

edited August 2014 in Technical Q&A
My player character struggles to climb a sloped collider that matches the angle of a set of stairs I have in the scene. Is there a way to make the player character walk up any slope, no matter how steep it is?

Comments

  • You can use the Player: Constrain Action to disable the effects of gravity during gameplay.  So long as the player's walking uphill, this should solve the issue.  And if you need the player to be able to walk downwards while gravity is disabled, you can also try placing an invisible sloped collider just above his head (to push him down)
  • Ok, I see what you're saying. It becomes a bit much when using terrain or other uneven surfaces though.

    It looks like this is a limitation of rigidbody.MovePosition(); I don't see a way to adjust the Slope Limit like you can for the Character Controller. I tried the Character Controller with the AC system, but the Player walked right through the sloped collider and gravity did not affect it at all.

    The workaround I've found for now is to create hotspots to move the player up and down the stairs. This way I can disable gravity, move the player to the top/bottom, then re-enable gravity to maintain expected behavior on uneven terrain.
  • I have a similar problem with slopes but my problem is the character will walk up just about any slope. If the collision cube isn't erected straight up, if it has any kind of angle to it, even slightly, I get a problem with the character walking and running up or on the collision cubes where they are not suppose to. How do you adjust the slope limit? I can work with it as it is but I just have to make sure everything is completely straight which can be a hassle sometimes, whenever I test the level I have to walk and run up to all the walls to make sure I got everything right. It also interferes sometimes with me getting the collisions just right. For instance I'm discovering that it's difficult to make realistic collisions with a swing set only using straight cubes.
  • Do you have Ignore gravity checked on the Player script, cyborgrabbit?
  • edited August 2014
    No I don't have the ignore gravity checked.

    The problem is much more subtle than that. It's just really hard to get the collisions right to where I don't have any problems at all.

    Then again I am making hard on myself because I'm not keeping it simple. My scene has a entire playground with stairs and slides. Stairs are really difficult to get right.
  • I'll be looking into an easier way of creating stairs, but it will take some time to go about it the best way.  If you could post an example screenshot of the kind of obstacles you're talking about, I'll take it into account.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.