Search Unity

hi i am Programming with c#. I have an error and i don´t know how to fix it .Please help !!

Discussion in 'Getting Started' started by Martin202121, Apr 13, 2021.

  1. Martin202121

    Martin202121

    Joined:
    Apr 13, 2021
    Posts:
    2
    hi i am Programming with c#. I have an error and i don´t know how to fix it .Please help !!
    error:
    Assets\PlayerMovment.cs(12,5): error CS0246: The type or namespace name 'Vectore3' could not be found (are you missing a using directive or an assembly reference?)
    code:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class PlayerMovment : MonoBehaviour
    {
    public CharacterController controller;
    public float speed = 12f;
    public float gravity = -9.81;
    Vectore3 velocity;
    // 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);
    }
    }
     
    Last edited: Apr 13, 2021
  2. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    481
    You are missing a semicolon at end of line:

    controller.Move(move *speed* Time.deltaTime)
     
  3. No, that is a pile of text. Please always use code tags when you share code on the forums like this.

    Code (CSharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5.  
    6. public class PlayerMovment : MonoBehaviour
    7. {
    8.  
    9.     public CharacterController controller;
    10.     public float speed = 12f;
    11.  
    12.     // Update is called once per frame
    13.     void Update()
    14.     {
    15.         float x = Input.GetAxis("Horizontal");
    16.         float z = Input.GetAxis("Vertical");
    17.  
    18.         Vector3 move = transform.right * x + transform.forward * z;
    19.         controller.Move(move *speed* Time.deltaTime)
    20.     }
    21. }
    The error message is clear. You need a ; somewhere in the 19th line. What is the confusion?
     
  4. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Ryiah likes this.
  5. Please do not replace your problem when someone replied to you. The answers don't make any sense going forward if you replace your question.
    Please learn how to use the code tags I mentioned above.
    Please do not duplicate your question in multiple topics.
    Please do open a new, separate thread for each individual problems you have.
     
    Ryiah and JoeStrout like this.