Hi! I found this log message when I try compile the script:
The name ‘LateralMovement’ does not denote a valid type (‘not found’)
The code has no errors in lines. But this message apeears. How to adjust this error?
var jumpDelay : float;
var jumpForce : double;
var canJump : boolean;
var timeSinceLastJump : float;
var base : GroundDetection;
var movement : LateralMovement;
function Start ()
{
dt = Time.deltaTime;
jumpButton = "Jump";
jumpForce = 6;
jumpDelay = 2.5;
canJump = false;
timeSinceLastJump = 10;
base = gameObject.GetComponentInChildren(GroundDecection);
movement = gameObject.GetComponent(LateralMovement);
}
function Update ()
{
timeSinceLastJump += dt;
if (base.onGround)
{
movement.SetSuspension(false);
if (timeSinceLastJump > jumpDelay)
{
canJump = true;
}
else if (!AirControl())
{
move.SetSuspension(true);
}
if (canJump Input.GetButton(jumpButton))
{
rigidbody.velocity.y += jumpForce;
canJump = false;
timeSinceLastJump = 0;
}
}
}
function AirControl()
{
return (rigidbody.velocity.y > 0);
}