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 /
  • Help Room /
avatar image
0
Question by Starks72 · Jan 01, 2018 at 01:34 AM · instantiatevector3randomerror message

What is causing my Spawner script to break Unity?

I believe it’s a combination of my player movement script which gives me an error code - Look rotation viewing vector is zero UnityEngine.Quaternion:LookRotation(Vector3), my camera script and my spawner script. When my camera and player movement script run separately and together I just receive the error code, it still plays. Once the spawner script is added it breaks unity. I’ve went line by line adding a new line after each play button press, to see when it breaks and it seems to start with the SpawnRandom method. What am I not seeing? What am I doing wrong? Thank you for all your help. It is much appreciated. each script is using: using System.Collections; using System.Collections.Generic; MonoBehaviour

alt textalt text

player-move-and-camera.png (214.3 kB)
screen-shot-2017-12-31-at-72726-pm.png (70.6 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by OneCept-Games · Jan 02, 2018 at 02:47 PM

You never end your SpawnRandom() function, that will cause Unity to time out.

Comment
Add comment · Show 3 · 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
avatar image Starks72 · Jan 02, 2018 at 09:39 PM 0
Share

I Don't fully understand what you mean, I never end the function? Do I create another method? Or would that be within the spawnRandom method add an else statement stop spawning? Or add an while (false) stop spawning? I thought it stopped when the timer/counter reset to = 0. Every time it "Instantiate" a random block the timer reset?

avatar image OneCept-Games Starks72 · Jan 02, 2018 at 09:53 PM 0
Share

Your while(true) {} has no "break", but I cannot see what comes after the if in you code, since according to your screenshot the } for the while and the method is missing... Paste more code, and I might be able to help more.

avatar image Starks72 · Jan 03, 2018 at 07:39 PM 0
Share

Thank you for you help. I actually decided to go a different route that would help reduce lines of code and other eventual methods. I don't know about saving performance issues but this is an workable alternative to the same feature I want in my game. This script does not have a counter, but triggers. Player out of trigger area = will not spawn a random colored block. Player in trigger area will spawn a random colored block. alt text

screen-shot-2018-01-02-at-61546-pm.png (100.2 kB)

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

156 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 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

Simple script, somewhat complicated issue involving changing a dimension of a vector at certain times. 1 Answer

plsss do help to select a spawnpoint from 3spawnpoints 1 Answer

Instantiate() Argument error 1 Answer

Instantiate Object using Vector3 at posision? 1 Answer

Cant Get a Bullet to Shoot (C#) 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