I was doing this game when this problem appeared
Assets / SampleAssets / 2D / Scripts / Platformer2DUserControl.cs (2.25): error CS0234: The type or namespace name
CrossPlatformInput' does not exist in the namespace
UnitySampleAssets'. Are you missing an assembly reference?
My code is as follows
using UnityEngine;
using UnitySampleAssets.CrossPlatformInput;
namespace UnitySampleAssets._2D
{
[RequireComponent(typeof (PlatformerCharacter2D))]
public class Platformer2DUserControl : MonoBehaviour
{
private PlatformerCharacter2D character;
private bool jump;
private void Awake()
{
character = GetComponent<PlatformerCharacter2D>();
}
private void Update()
{
if(!jump)
// Read the jump input in Update so button presses aren't missed.
jump = CrossPlatformInputManager.GetButtonDown("Jump");
}
private void FixedUpdate()
{
// Read the inputs.
bool crouch = Input.GetKey(KeyCode.LeftControl);
float h = CrossPlatformInputManager.GetAxis("Horizontal");
// Pass all parameters to the character control script.
character.Move(h, crouch, jump);
jump = false;
}
}
}