Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity claiming name does not exist

Discussion in 'AR/VR (XR) Discussion' started by rdaamodt99, Apr 29, 2020.

  1. rdaamodt99

    rdaamodt99

    Joined:
    Apr 28, 2020
    Posts:
    1
    Hi, I am following along with a youtube tutorial. Currently, I am Implementing movement W/ gravity. however, unity is claiming "charaterController" does not exist. how can I fix this?
     

    Attached Files:

  2. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,924
    That sounds like a non-VR related issue. You should follow some basic Unity tutorials first, especially ones that deal with character controllers (it's a built-in feature of Unity that they've been shipping for ... I think ... 10 years? Maybe 15 years now? - so there's a lot of tutorials).

    Unfortunately, they end-of-lifed this recently, so you may need to search to find some of the free, Unity-provided, source-code (can't get it directly from Unity any more). Again: look for generic Unity tutorials.
     
  3. davidlemaster

    davidlemaster

    Joined:
    Apr 30, 2020
    Posts:
    1
    hey id actually like some help im also following a tutorial but for me its saying that the name "gravity does not exist"

    heres my code

    using UnityEngine;

    public class movement : MonoBehaviour
    {
    public CharacterController controller;
    public float speed = 12f;

    Vector3 velocity;

    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
    float x = Input.GetAxis("Horizontal");
    float z = Input.GetAxis("Vertical");

    Vector3 move = transform.right * x + transform.forward * z;

    controller.Move(move * speed * Time.deltaTime);

    velocity.y += gravity * Time.deltaTime;

    controller.Move(velocity * Time.deltaTime);
    }
    }
     
  4. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,924
    If a tutorial doesn't work, always speak to the tutorial author about it first. They are the one you should ask for help - if something's wrong with their tutorial, they'll want to know.

    Second: this is a forum for VR development. If it's not VR related, this is the wrong place to post :)