Hi everyone. I basically just got Unity, and I'm just starting out with scripting with c#, or rather, I am utterly lost, heh.
I could use some assistance. I'm doing a very basic 2D project to just learn how to code. And I have some trouble, I am getting a compiling error and I don't know what's wrong:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player1_Controls : MonoBehaviour {
public float speed = 10f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float Dirx = Input.GetAxis ("Horizontal") * speed * Time.deltaTime;
void SetTransformX(float n){
transform.position = new Vector3(n, transform.position.y, transform.position.z);
}
void Update (){
SetTransformX(7.0f);
}
}
}