Character - Slope Settings

Slope settings allow your character to walk on sloped surfaces by rotating the colliders to match the surface.

You can also support slopes by simply snapping to the ground and not rotating. This is more typical in old school pixel based games. See Character - Supporting Slopes without Rotating.

 

Remember: Even if you do rotate your controller you may still keep your character sprite or model rotation free by using a DontRotate script.


The following slope controls are available: 

Setting

Description

Calculate Slopes

If this is on the character will calculate the angle of slope it is standing on. This will be available via the property SlopeTargetRotation(). You may way to calculate slopes without rotating to, for example, drive sliding behaviour.

 

Rotate to Slopes

Should the character transform rotate to the angle of the slope. Note that you do not have to enable this to enable slopes see Supporting Slopes without Rotating

This setting is generally used for 2.5D characters or characters where the alternate method is not adequate.

If your character rotates to slopes it does not mean your sprite needs to rotate. You can add a DontRotateSpriteScript to your sprite to support this.

Max Slope Rotation

How far is your character allowed to rotate from identity (0).

 

Note that although large values will allow you to run up walls or even upside down not all movements support this. See the section on Loops for more details.

Rotation Speed

How fast will the character move to the target rotation.

 

If your sprite does not rotate you should use a very large value (e.g. 720). Smaller values will mean your character slowly rights themselves when jumping and can cause issues on steep curves.

Minimum Wall Angle

The minimum angle at which a piece of geometry can be considered a wall.

 

This is a relative measure and is calculated based on the normal of the collision between a side collider and the geometry.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk