Skip to main content
Search our knowledge base

What is CS1525?

Comments

3 comments

  • Dhruv Dubey
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class PlayerMovement : MonoBehaviour {

        // This is a reference to the Rigidbody component called "rb"
        public Rigidbody rb;

        public float forwardForce = 2000f;  // Variable that determines the forward force
        public float sidewaysForce = 500f;  // Variable that determines the sideways force
        //public float upwardForce = 200f;

        // We marked this as "Fixed"Update because we
        // are using it to mess with physics.
        void FixedUpdate ()
        {
            // Add a forward force
            rb.AddForce(0, 0, forwardForce * Time.deltaTime);
            public void turnRight ()
            {
                rb.AddForce(sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
            }
            public void turnLeft ()
            {
                rb.AddForce(-sidewaysForce * Time.deltaTime, 0, 0, ForceMode.VelocityChange);
            }

            
            if (rb.position.y < -1f )
            {
                FindObjectOfType<GameManager>().EndGame();
            }
        }
    }
     
     
     
     
     
     
    this the code that i am using and it is giving me 15 errors what do I do
    0
  • Jarvis

    Hello there,

    Thank you for your comment. Sorry to see you are having some scripting errors here. Sadly, I cannot advise on technical issues here, however we do have support forums which may help you resolve this!

    Please visit our Scripting forum here: https://forum.unity.com/forums/scripting.12/

    If you search in the forums for the subject or error you are getting, or create a post of your own, I am confident that you will find the answer you are looking for.

    Thanks!

    0
  • Dane Lupien
    using System;

     

    class MainClass {
    publicstaticvoid Main (string[] args) {
    Console.WriteLine ("This is a quiz for Civics Class");
    Console.WriteLine("It is a true or false Quiz");
     
    string answer;
    Console.Write("Are you ready item y/n: ");
    answer = (Console.ReadLine()

     

    if (answer == "y"){
    answer=true;
    }
     
    else {
    answer=false;
    }
     
     
    }
    }
    //It keeps saying the if statement is wrong, any fixes?
    1

Please sign in to leave a comment.