Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Max_dragotoba · Apr 13 at 10:49 PM · codepage

why wont my code effect the game

I have my code here and even when I comment out the whole thing and save the outcome won't change. I've checked in the assets and it shows the newest version that I created but when I run the code the same thing happens as normal. To add on when I add a new variable the inspecter does not change.

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class bean_2_bot2 : MonoBehaviour
 {
     public static float countb = 1;
     public int stop = 0;
     public int stop2 = 0;
     public int no_more = 0;
     public int not_many = 0;
     public int enter = 0;
     public int enter2 = 0;
     // Start is called before the first frame update
     public string forward = "forward";
     // Start is called before the first frame update
     void Start()
     {
             
         /*public Transform object;
         var bean1 = GameObject.Find("BEAN 1");
         var pos1 = bean1.transform.position;
         var bean2 = GameObject.Find("BEAN 2");
         public var pos = bean2.transform.position;*/
 
     }
 
     public void stop_edit()
     {
         enter += 1;
         if (no_more > 0)
         {
             //Move(forward, 5);
             stop += 1;
         }
         Move(forward, no_more);
 
         no_more +=1;
     }
 
     void Move(string direction, int amount)
     {
         //public static Vector3 positionen;
         if (direction == "forward")
         {
             transform.position += Vector3.right * amount;
         }
 
         if (direction == "jump")
         {
             //transform.position += Vector3.up * 1;
             //float nice = 5.0f;
             //float jump = Input.GetAxis("Jump");
 
             //Rigidbody rigidBody;
             //rigidBody = GetComponent<Rigidbody>();
 
 
             //float jumpMovement = rigidBody.velocity.y;
 
                 
             //transform.position += Vector3.up * 1.5f / 10f;
             //countb = 1;
 
             if (countb > 0)
             {
                 transform.position += Vector3.up * (1.5f / (countb * 2f + 3f));
                 countb += 0.5f;
                 if (countb == 75)
                 {
                     countb = 0;
                 }
             }
 
         }
     }
 
 
 
 
 
 
 
 
     // Update is called once per frame
     public void Update()
     {
         //not_many += 1;
         //Move(forward, stop);
         //if (true)//bean_2_health.health_S_2 > Score.health_S && //stop %2 == 0 && //not_many >=10
         //{
         Move("forward", 1);
         not_many = 0;
         //}
         stop2 = stop;
     }
 }
 
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sandbaydev · Apr 14 at 03:34 AM 0
Share

Have you attached your script to a game object?

Add Debug.Log("something happening?") inside the Start() function (line 20 or so) and check console when playing: it should print that statement.

I don't see any code that would make any variable change. The stop_edit is not called anywhere.

Good luck.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

135 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why The player don't move? 0 Answers

BCE0019: 'text' is not a member of UnityEngine.component 2 Answers

i need help with make an attack animation only when the player is near 1 Answer

How can I make the character move while jumping 1 Answer

Intermittent bug occurring when re spawning 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges