Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question The Name ‘hightOffset’ does not exist in the current statement

Discussion in 'Documentation' started by forgottonland, May 10, 2023.

  1. forgottonland

    forgottonland

    Joined:
    May 9, 2023
    Posts:
    7
    Why it’s a variable look at my code and pls get me an awnser but look at my code
    Code (CSharp):
    1. public float hightOffset = 10;
    that’s the part of my code that doesn’t work if this helps I’m making a flappy bird game off a tutorial called (The Unity Tutorial For Complete Beginners) ok pls help and I’m in 2d so yea now that you have enough information pls help.
     
    Last edited: May 10, 2023
  2. IDK, this says it's not
    hightOffset
    , it is
    heightOffset
    . Are you sure you didn't mistyped your mistype elsewhere?

    Please next time paste the exact error you get and the exact and whole script you are working with. And finally, next time please check where you are posting. The Documentation topic is about Unity's documentation and processes. Try to submit scripting problems in the Scripting section.
     
    forgottonland likes this.
  3. forgottonland

    forgottonland

    Joined:
    May 9, 2023
    Posts:
    7
    I Did So Thank You
    And Do You Know How To Make Audio Play With Code? For My Point System Look
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5. using UnityEngine.SceneManagement;
    6.  
    7. public class LogicScript : MonoBehaviour
    8. {
    9.     public int playerScore;
    10.     public Text scoreText;
    11.     public GameObject GameOverScreen;
    12.     public AudioSource Point;
    13.  
    14.     [ContextMenu("Increase Score")]
    15.     public void addScore(int scoreToAdd)
    16.     {
    17.         playerScore = playerScore + scoreToAdd;
    18.         (Where I Want Audio)
    19.         scoreText.text = playerScore.ToString();
    20.     }
    21.  
    22.     public void restartGame()
    23.     {
    24.         SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    25.     }
    26.  
    27.     public void gameOver()
    28.     {
    29.         GameOverScreen.SetActive(true);
    30.     }
    31.  
    32. }
    33.  
     
  4. forgottonland

    forgottonland

    Joined:
    May 9, 2023
    Posts:
    7
    Because I Have A little Sound I Wanna Play When You Get A Point Because Flappy Bird Game :D
     
  5. forgottonland

    forgottonland

    Joined:
    May 9, 2023
    Posts:
    7
  6. forgottonland

    forgottonland

    Joined:
    May 9, 2023
    Posts:
    7
    um its not explained that well and it doesn't work because its for 3d unity
     
  7. forgottonland

    forgottonland

    Joined:
    May 9, 2023
    Posts:
    7
    so anything better? and that thanks i said has been demoted to just thanks for trying. because I said that before I looked at the link \_()_/