So I’m new to scripting (and Unity, and game making for that matter). But, I’m working on a simple 2D side scroller game.
I’d like to put some ladders in the game to expand the game a bit.
What’s the best game object to use (I have a cube that’s in the shape of a really long rectangle)? And, how should the code read?
I’ve included this portion of code in my “PlayerMovement” script (Javascript).
if (OnLadder)
{
moveDirection = new Vector3(0, Input.GetAxis("Vertical"),0);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= climbSpeed;
}
I’ve got the “Is Trigger” set for the game object…
Any suggestions? Thanks!!