Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

error CS0246: The type or namespace name 'vecter3' could not be found

Discussion in 'Scripting' started by itspicklerickandmorty, Apr 7, 2020.

  1. itspicklerickandmorty

    itspicklerickandmorty

    Joined:
    Apr 6, 2020
    Posts:
    16
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Moveball : MonoBehaviour
    6. {
    7.     Rigidbody rb;
    8.     public int ballspeed = 0;
    9.     public int jumpspeed = 0;
    10.     // Start is called before the first frame update
    11.     void Start()
    12.     {
    13.         rb = GetComponent<Rigidbody>();
    14.     }
    15.  
    16.     // Update is called once per frame
    17.     void Update()
    18.     {
    19.         float Hmove = Input.GetAxis ("Horizontal");
    20.         float Vmove = Input.GetAxis ("Vertical");
    21.  
    22.         Vector3 ballmove = new Vector3(Hmove, 0.0f, Vmove);
    23.         rb.AddForce (ballmove * ballspeed);
    24.  
    25.         if(Input.GetKey(KeyCode.Space));
    26.         {
    27.             Vecter3 balljump = new Vecter3 (0.0f, 0.0f, 0.0f);
    28.             rb.AddForce(balljump * ballspeed);
    29.  
    30.         }
    31.     }
    32. }
    33.  
    \
    am i doing anything wrong or no
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,971
    Joe-Censored likes this.
  3. itspicklerickandmorty

    itspicklerickandmorty

    Joined:
    Apr 6, 2020
    Posts:
    16
    I did that but I use visual studios and every time I double click on the error it takes me right back to where I was last typing is there anything wrong with code because I'm trying to make the ball jump could you edit the code where it needs to be edited
     
  4. itspicklerickandmorty

    itspicklerickandmorty

    Joined:
    Apr 6, 2020
    Posts:
    16
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Check the spelling on line 27 of what you posted.