Skip to content

Scripts.Movement

Wesley Haws edited this page Jun 8, 2017 · 7 revisions

Scripts - Movement

What does this do?


Allows a player object to move around based on keyboard/controller input. Will play animations on Animators.

Who/What is this for?


This is for the player object only.

Setup


Example Movement Controller Setup:

Movement controller Setup Example

Parameter Type Description
Parkour Object Tag string Tag name. Objects tagged with this will be able to be jumped or hurdled.
Parkour Distance float Raycast distance. How close you have to be to the tagged object to parkour on it.
Walk Speed float Move speed when not running.
Run Speed float Move speed when running.
Limit Diagonal Speed bool Prevent/Allow moving faster when holding down forward and sideways keys at the same time.
Toggle Run bool Legacy. Allow/Disallow toggling running.
Can Jump bool Allow/Disallow vertical movement when pressing the jump key.
Jump Speed float How fast/How high you will move vertically when pressing the jump key.
Gravity float How fast the player object will fall.
Falling Damage Threshold float How far the player object can fall before losing health. (Requires "Health" script to be attached at the same level)
Slide When Over Slope Limit bool Fall along object when character controller slope limit exceeded. (Requires character controller)
Slide On Tagged Object bool Tag Name. Tagged object will cause the player to continue to move in movement direction for a period of time.
Slide Speed float Move speed of the player to continue to move after not pressing any key.
Air Control bool Allow the player object to change direction in mid air.
Anti Bump Factor float Prevent jittering effect. Default value sufficient but change if jittering occurs. Only use on as needed basis.
Anit Bunny Hop Factor float Prevents a bouncing effect when holding the jump key.
Anim Animator List Mecanim Animator list to apply animation to when moving.
Health Script Script Apply the health script here. No other script will work.
Ground Locked bool Can/Cannot leave the ground.
Move Locked bool Can/Cannot move in any way.
Move Up Only bool Can/Cannot move in X,Z direction (Locks camera as well).
Move Side Only bool Can/Cannot move in forward or backward motion (locks camera as well).
On Ladder bool If enabled can only move up or down. Locks camera to only allow looking up or down.
Move Direction Vector3 Legacy. Do not add anything here. For script access only.
Not Effected By Gravity bool To ignore the effect of gravity or not.
Clone this wiki locally