Unity error idk what i did
1 Like
You are missing the } at the end of the file. You are also missing the ; at the end of the translate
PS: Welcome to the community!
1 Like
where?
thanks
Here. This should be
void Update()
{
transform.Translate(x,y,z); // <- missing ;
} // <- missing }
}
1 Like
This is what the code in your screenshot should look like:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mover : MonoBehaviour
{
float x = 0;
float y = 0f;
float z = 0;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Translate(x, y, z);
}
}
1 Like
thank you
Welcome to GameDev Community!
It would also be a good idea to put an âfâ behind the zeroes for your float variables X and Z.
â0â still counts as a number and the presence of an âfâ is still important to C# even if you are not using a decimal.
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.