using UnityEngine;
[RequireComponent(typeof(PlatformerCharacter2D))]
public class Platformer2DUserControl : MonoBehaviour
{
private PlatformerCharacter2D character;
private bool jump;
void Awake()
{
character = GetComponent<PlatformerCharacter2D>();
}
void Update ()
{
// Read the jump input in Update so button presses aren't missed.
if (Input.GetButtonDown("Jump")) jump = true;
}
void FixedUpdate()
{
// Read the inputs.
bool crouch = Input.GetKey(KeyCode.LeftControl);
float h = Input.GetAxis("Horizontal");
// Pass all parameters to the character control script.
character.Move( h, crouch , jump );
// Reset the jump input once it has been used.
jump = false;
}
}
Hi I got the sample assets on the store and imported the 2d folder and now it doesn’t recognise PlatformerCharacter2D. : was following this tutorial 1. How to make a 2D Platformer - Basics - Unity Tutorial - YouTube
i already got rid of this error [The name `CrossPlatformInput' does not exist in the current context - Questions & Answers - Unity Discussions] but it still won’t work.