Thread: App development, got a problem

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 App development, got a problem 
    Banned
    Join Date
    Jul 2016
    Posts
    74
    Thanks given
    49
    Thanks received
    15
    Rep Power
    0
    Hello, so recently i've been following a tutorial on youtube.

    This was the tutorial Video:



    So i get this werid error, il show you the code.


    Attached image
    Attached image



    Here's the entire code.



    For some reason theirs an errors under the if statement.

    public class Bounce : MonoBehaviour
    {
    float lerpTime;
    float currentLerpTime;
    float perc = 1;

    Vector3 startPos;
    Vector3 endPos;

    void Update ()


    if(inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right") ||
    {
    if(perc == 1)
    {

    lerpTime = 1;
    currentLerpTime = 0;
    }

    }

    startPos = gameObject.transform.position;

    if(input.GetButtonDown("right")&& gameObject.transform.position == endPos)
    {
    EndPos = new Vector3(transform.position.x + 1, transform.position.y,transform.position.z );
    }
    if(input.GetButtonDown("left")&& gameObject.transform.position == endPos)
    {
    EndPos = new Vector3(transform.position.x - 1, transform.position.y,transform.position.z );
    }
    if(input.GetButtonDown("up")&& gameObject.transform.position == endPos)
    {
    EndPos = new Vector3(transform.position.x, transform.position.y,transform.position.z + 1);
    }
    if(input.GetButtonDown("down")&& gameObject.transform.position == endPos)
    {
    EndPos = new Vector3(transform.position.x, transform.position.y,transform.position.z - 1);
    }

    currentLerpTime += Time.deltaTime * 5.5;
    }
    }
    perc = currentLerpTime / LerpTime;
    gameOject.transform.positi

















    GOT THIS LAST ERROR! THANKS TO SOCCERJUNKI HE HELPED ME FIX MOST OF THEM.




    Attached image
    Reply With Quote  
     

  2. #2  
    Donator

    Join Date
    Dec 2009
    Posts
    260
    Thanks given
    16
    Thanks received
    51
    Rep Power
    14
    maybe i could be wrong but it looks like you're missing a bracket

    Code:
    void Update () {
    
    
    if(inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right") || 
    {
    if(perc == 1)
    {
    Attached image
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Jul 2016
    Posts
    74
    Thanks given
    49
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by Soccerjunki View Post
    maybe i could be wrong but it looks like you're missing a bracket

    Code:
    void Update () {
    
    
    if(inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right") || 
    {
    if(perc == 1)
    {
    appreciate the help, but that isn't the case.

    Attached image


    Attached image

    here's more information!
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Nov 2009
    Posts
    199
    Thanks given
    66
    Thanks received
    45
    Rep Power
    74
    remove the || after ("right") and put another round bracket )

    check your parentheses, always
    Reply With Quote  
     

  5. #5  
    Donator

    Join Date
    Dec 2009
    Posts
    260
    Thanks given
    16
    Thanks received
    51
    Rep Power
    14
    Quote Originally Posted by RSPS Hobo View Post
    appreciate the help, but that isn't the case.

    Attached image


    Attached image

    here's more information!
    yes it is, your void needs an opening bracket as highlighted in red.

    Code:
    public class Bounce: MonoBehaviour {
            float lerpTime;
            float currentLerpTime;
            float perc = 1;
    
            Vector3 startPos;
            Vector3 endPos;
    
            void Update() {
    
    
                if (inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right") || {
                        if (perc == 1) {
    
                            lerpTime = 1;
                            currentLerpTime = 0;
                        }
    
                    }
    
                    startPos = gameObject.transform.position;
    
                    if (input.GetButtonDown("right") && gameObject.transform.position == endPos) {
                        EndPos = new Vector3(transform.position.x + 1, transform.position.y, transform.position.z);
                    }
                    if (input.GetButtonDown("left") && gameObject.transform.position == endPos) {
                        EndPos = new Vector3(transform.position.x - 1, transform.position.y, transform.position.z);
                    }
                    if (input.GetButtonDown("up") && gameObject.transform.position == endPos) {
                        EndPos = new Vector3(transform.position.x, transform.position.y, transform.position.z + 1);
                    }
                    if (input.GetButtonDown("down") && gameObject.transform.position == endPos) {
                        EndPos = new Vector3(transform.position.x, transform.position.y, transform.position.z - 1);
                    }
    
                    currentLerpTime += Time.deltaTime * 5.5;
                }
            }
            perc = currentLerpTime / LerpTime;
    also this

    Quote Originally Posted by Eyeownyew View Post
    remove the || after ("right") and put another round bracket )

    check your parentheses, always
    Attached image
    Reply With Quote  
     

  6. Thankful user:


  7. #6  
    Banned
    Join Date
    Jul 2016
    Posts
    74
    Thanks given
    49
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by Soccerjunki View Post
    yes it is, your void needs an opening bracket as highlighted in red.

    Code:
    public class Bounce: MonoBehaviour {
            float lerpTime;
            float currentLerpTime;
            float perc = 1;
    
            Vector3 startPos;
            Vector3 endPos;
    
            void Update() {
    
    
                if (inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right") || {
                        if (perc == 1) {
    
                            lerpTime = 1;
                            currentLerpTime = 0;
                        }
    
                    }
    
                    startPos = gameObject.transform.position;
    
                    if (input.GetButtonDown("right") && gameObject.transform.position == endPos) {
                        EndPos = new Vector3(transform.position.x + 1, transform.position.y, transform.position.z);
                    }
                    if (input.GetButtonDown("left") && gameObject.transform.position == endPos) {
                        EndPos = new Vector3(transform.position.x - 1, transform.position.y, transform.position.z);
                    }
                    if (input.GetButtonDown("up") && gameObject.transform.position == endPos) {
                        EndPos = new Vector3(transform.position.x, transform.position.y, transform.position.z + 1);
                    }
                    if (input.GetButtonDown("down") && gameObject.transform.position == endPos) {
                        EndPos = new Vector3(transform.position.x, transform.position.y, transform.position.z - 1);
                    }
    
                    currentLerpTime += Time.deltaTime * 5.5;
                }
            }
            perc = currentLerpTime / LerpTime;
    also this
    Oh wow Thanks!

    any chance you know how to fix the other errors xD
    Reply With Quote  
     

  8. #7  
    Donator

    Join Date
    Dec 2009
    Posts
    260
    Thanks given
    16
    Thanks received
    51
    Rep Power
    14
    Quote Originally Posted by RSPS Hobo View Post
    Oh wow Thanks!

    any chance you know how to fix the other errors xD
    Change this
    Code:
    if (inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right") || {
    to this

    Code:
    if (inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right")){
    Attached image
    Reply With Quote  
     

  9. Thankful user:


  10. #8  
    Banned
    Join Date
    Jul 2016
    Posts
    74
    Thanks given
    49
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by Soccerjunki View Post
    Change this
    Code:
    if (inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right") || {
    to this

    Code:
    if (inputGetButtonDown("up") || inputGetButtonDown("down") || inputGetButtonDown("left") || inputGetButtonDown("right")){
    You are literally the best person ever
    spent ages trying to fix it


    JUST GOT ONE MORE ERROR IF YOU DONT MIND


    Attached image

    Attached image



    if anyone can help me with line 57
    Reply With Quote  
     

  11. #9  
    Donator

    Join Date
    Dec 2009
    Posts
    260
    Thanks given
    16
    Thanks received
    51
    Rep Power
    14
    Quote Originally Posted by RSPS Hobo View Post
    You are literally the best person ever
    spent ages trying to fix it


    JUST GOT ONE MORE ERROR IF YOU DONT MIND


    Attached image

    Attached image



    if anyone can help me with line 57

    im gonna let you try to solve this one because it's literally right there
    Attached image
    Reply With Quote  
     

  12. Thankful user:


  13. #10  
    Banned
    Join Date
    Jul 2016
    Posts
    74
    Thanks given
    49
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by Soccerjunki View Post
    im gonna let you try to solve this one because it's literally right there
    yeah got it.
    thanks for the help btw

    What do these mean? i have no understanding of why those errors are there, if you could brefily explain why, and then push me into the right direction on how to go about it
    would mean alot

    Attached image
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. i got a problem
    By kirk in forum Help
    Replies: 3
    Last Post: 09-03-2009, 07:00 PM
  2. Cache508, don't got it - problem?
    By Phunage in forum Help
    Replies: 2
    Last Post: 08-19-2009, 04:57 PM
  3. Ok Here I got some problems [ Help guus :) ]
    By Affliction in forum Help
    Replies: 4
    Last Post: 08-17-2009, 03:01 AM
  4. help i got a problem with my range bow
    By levybol in forum Help
    Replies: 2
    Last Post: 05-28-2009, 09:57 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •