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