can someone help me out to find whats wrong with this?,Can someone please help me figure out why these two errors keep showing up after doing such a simple script?

**using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () { 
	transform.translate(1f* time.deltatime,0f, 0f)
}

}

It always tells me the same two errors -Assets/NewBehaviorscript.cs(14,9): error CS1525: Unexpected symbol ‘}’ and -Assets/Newbehaviourscript.cs(18,1) error CS8025: Parsing Error.
,

And the same thing shows up when i type using UnityEngine; using System.Collections; public class NewBehaviourScript : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { transform.translate(input.getaxis("horizontal" ) } }

@rutter plz help me out if you can

@zoogyburer if you can plz help me figure this out. thx

hey @doublemax can u fix up the seccond one two?

2 Answers

2

Check the capitalization of all class and method names.

Also, use the help the code editor / IDE provides. It should have told you what’s wrong in most cases.

using UnityEngine; using System.Collections;

public class NewBehaviourScript : MonoBehaviour
{

  // Use this for initialization
  void Start()
  {

  }

  // Update is called once per frame
  void Update() {
    transform.Translate(1f * Time.deltaTime, 0f, 0f);
  }
}

thank you so much that fixed my problem

@doublemax could you please fix the seccond code because i tried it with your advice and its not woking for me -thx

just so you know im a complete noob with coding and all things when it come to makeing games.

No offense, but even if you're a beginner, with a little bit of effort on your side, you should be able to fix this kind of errors yourself. Unity provides a very good documentation. E.g. search for "input.getaxis" and you will find this: https://docs.unity3d.com/550/Documentation/ScriptReference/Input.GetAxis.html This will show you the correct spelling of "Input.GetAxis" and even a code sample of something very similar of what you want to do. And then you will end up with something like this: transform.Translate(Input.GetAxis("Horizontal") * Time.deltaTime, 0f, 0f);