Can anyone tell me why #if is ignored? Am I missing something to install?
public class PlayrScript : MonoBehaviour
{
private float playerSpeed = 200;
private float directionSpeed = 20;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
#if Unity_editor
float moveOrizontal = Input.GetAxis("Horizontal");
// Debug.Log("Input: " + moveOrizontal);
transform.position = Vector3.Lerp(gameObject.transform.position, new Vector3(Mathf.Clamp(gameObject.transform.position.x + moveOrizontal, -2.5f, 2.5f), gameObject.transform.position.y, gameObject.transform.position.z), directionSpeed + Time.deltaTime);
#endif
GetComponent<Rigidbody>().velocity = Vector3.forward * playerSpeed * Time.deltaTime;
}
}