So I am very new to unity and C# and want to make a small level for fun. I would like to be able to make it so when the player walks towards the wall the automatically climb up it (No animations yet) So I created a cube and made it a trigger and invisible. I have made a small script but cant figure out what is stopping it from working. This error message comes up (Expression denotes a type', where a
variable’, value' or
method group’ was expected)
Here is my code: using
UnityEngine;
using System.Collections;
public class FenceClimbing : MonoBehaviour {
void OnTriggerEnter(Collider other){
transform.position += Vector3 (0, 1, 0);
}
}
Can you please tell me what is wrong and why?