Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
This question was closed Jul 30, 2019 at 07:10 AM by Beginner_at_Unity for the following reason:

Case answered privately by unity development team.

avatar image
0
Question by Beginner_at_Unity · Jul 24, 2019 at 03:11 AM · spawnclonemissing

Fruit ninja course

I'm following a course in the udemy website. Earlier my project could not destroy the fruit by making them disappear. Now I succeeded and found that the codes given by the tutorial were not properly written as other students had the same problem. However, now that i added sliced fruits, both the spawned fruits and the sliced fruits just don't appear anymore. I have inserted the link for the project so anyone can download to test it out https://drive.google.com/file/d/1akEMR8eqHrJA0_0Me_B1xwXfvJMkuup-/view?usp=sharing - password not required . The picture has also been inserted so you can see the fruits just refuse to appear.

image


edit (moved from answer)
I already carefully tested the project. Whether the fruits and fruit cuts are enabled / disabled, the results are the same. I am pasting the spawning codes here. Let me know if you need more codes.

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class FruitSpawner : MonoBehaviour
 {
     public GameObject fruit;
     public float maxX;
 
     // Start is called before the first frame update
     void Start()
     {
         Invoke("StartSpawning", 1f);
     }
 
 
     public void StartSpawning()
     {
         InvokeRepeating("SpawnFruitGroups", 1, 6f);
     }
 
     public void StopSpawning()
     {
         CancelInvoke("SpawnFruitGroup");
         StopCoroutine("SpawnFruit");
     }
 
 
     public void SpawnFruitGroups()
     {
         StartCoroutine("SpawnFruit");
     }
 
 
     IEnumerator SpawnFruit()
     {
         for (int i = 0; i < 5; i++)
         {
             float Rand = Random.RandomRange(-maxX, maxX);
             Vector3 pos = new Vector3(Rand, transform.position.y, 0);
             GameObject f = Instantiate(fruit, pos, Quaternion.identity) as GameObject;
             f.GetComponent<Rigidbody2D>().AddForce(new Vector2(0, 15f), ForceMode2D.Impulse);
             f.GetComponent<Rigidbody2D>().AddTorque(Random.Range(-20f, 20f));
             yield return new WaitForSeconds(0.5f);
         }
     }
 }


tutorial-53.jpg (222.9 kB)
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 Beginner_at_Unity · Jul 29, 2019 at 04:17 AM 0
Share

This case is not solved yet.

1 Reply

  • Sort: 
avatar image
0

Answer by Casiell · Jul 24, 2019 at 06:31 AM

I'm not really eager to download the project, but from the screen you provided it may be possible that your fruit objects are just disabled? If that's not the problem, please paste relevant code (code that spawns your fruit) into your question so we can try to help further

Comment
Add comment · Share
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

Follow this Question

Answers Answers and Comments

111 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

Related Questions

Missing Component Exception Error 3 Answers

clone object make a new script 0 Answers

Question about instantiate AI 0 Answers

How to have a cloned/duplicated enemy react the same way the original does? 1 Answer

When I pause the game the clone does not stop 0 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