Difference between revisions of "SidescrollerMovement"

From Headbone Creative
Jump to: navigation, search
(Initial page)
 
(Changed to free scripts)
 
Line 29: Line 29:
  
 
[[Category:API]]
 
[[Category:API]]
[[Category:Premium Scripts]]
+
[[Category:Free Scripts]]

Latest revision as of 20:44, 16 April 2013

This script is an advanced version of the Sidescroller Movement script included with Unity's Mobile Standard Assets. It has been converted to C# and modified to be more configurable. By default, the character this is added to will be able to move left and right along the X axis. The class has flags that can be set to enable jumping in the Y axis and movement in the Z axis. There are also settings that will allow the character to run if enabled.

Contents

[edit] Public Variables

[edit] canMoveInZ : bool

Whether or not the character takes vertical input to move in the Z direction.

[edit] movementSpeed : float

How fast the character moves.

[edit] canRun : bool

Whether or not the character can run.

[edit] runSpeed : float

How fast the character moves when running.

[edit] canJump : bool

Whether or not the character can jump.

[edit] jumpSpeed : float

How fast the character jumps.

[edit] inAirMultiplier : float

Limiter for ground speed while jumping.

[edit] horizontalAxisName : string

The name of the axis from which the horizontal input is taken. This is translated into X axis motion.

[edit] verticalAxisName : string

The name of the axis from which the vertical input is taken. This is translated into Z axis motion (if enabled).

[edit] runningButtonName : string

The name of the button which, when pressed, will let the character run.

[edit] jumpButtonName : string

The name of the button that allows the button to jump.

[edit] Example

The toolbox contains a prefab and a demo scene showing how the Sidescroller Movement script can be used.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox