) Expected

My script says there is no issues, but when I get back into Unity, a compiler error shows up and says there is a bracket expected, here is my code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LadderClimb : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
float verticalSpeed = 2.0f;
}

// Update is called once per frame
void Update()
{
if (hit.collider.gameObject.tag == “ladder”)
{
if (Input.GetKey(KeyCode.w) {
transform.translate(0, 1, 0)
}
if (Input.GetKey(KeyCode.s) {
transform.translate(0, -0b1, 0)
}

}

could someone please help me, the code is for climbing a ladder, it is applied to the character controller.

public class LadderClimb : MonoBehaviour
    {
        // Start is called before the first frame update
        void Start()
        {
            float verticalSpeed = 2.0f;
        }

        // Update is called once per frame
        void Update()
        {
            if (hit.collider.gameObject.tag == "ladder")
            {
                if (Input.GetKey(KeyCode.w) {
                    transform.translate(0, 1, 0)
                }
                if (Input.GetKey(KeyCode.s) {
                    transform.translate(0, -0b1, 0)
                }
            }
        }
    } ////<------------------This one is missing

and “hit” doesnt exist

transform.translate also doesn’t exist.
this is how you do translate Unity - Scripting API: Transform.Translate

not sure about what are you doing with “hit”

if you try to raycast it Unity - Scripting API: Physics.Raycast

if you try to collision with it Unity - Scripting API: MonoBehaviour.OnTriggerStay(Collider)

in coding big case and low case are matter “KeyCode.s” doesn’t exist but “KeyCode.S”