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
-1
Question by alaarhouma · Jan 31, 2014 at 05:07 PM ·

ASDAsdASDasdqweqw3edqwdQWDEqwedQWD

QWDqwdqwd

Comment
Add comment · Show 10
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 Vardan Meliksetyan · Jan 31, 2014 at 06:07 PM 0
Share

Where is my answer you write wrong code, why are you delete my answer?

avatar image alaarhouma · Jan 31, 2014 at 06:09 PM 0
Share

no i didn't delete anything!!! I'm sorry

avatar image clunk47 · Jan 31, 2014 at 06:42 PM 0
Share

Why not help us help you, by posting the error you're getting in the console? I can tell you though, transform.position is a Vector3, not an integer.

avatar image fafase · Jan 31, 2014 at 07:53 PM 0
Share

The answer to your problem is in my answer I gave 2h ago.

  if(array[i].transform.position = 0)

Is wrong. A position cannot be a float.

avatar image alaarhouma · Jan 31, 2014 at 08:07 PM 0
Share

yes i understood this but i want to know how exactly i can replace my if statement? thanks

Show more comments

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by fafase · Jan 31, 2014 at 05:09 PM

Inside your if statement you are assigning and not comparing. Still, you cannot compare a float with 0 since a float has little chance to be exactly 0. You should either round it or then check if the value is near 0.

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
avatar image
0

Answer by alaarhouma · Jan 31, 2014 at 05:40 PM

can you give me an example how to do that. im pretty new using unity 3d and i was wondering if array.RemoveAt(i); or its array.RemoveAt(i--); because the index needs to stay in the same place. thank you for your swift reply

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
avatar image
0

Answer by Vardan Meliksetyan · Jan 31, 2014 at 06:17 PM

for (i = 0; i <= array.Length; i++) {

if (array[i].transform.position = 0)

array.RemoveAt(i);

**Look this code you are deleting i array.RemoveAt(i); element after that you are calling that element,

print(“Removed element: “ + array[i].name);

but that element does not exists !:)**

print(“Removed element: “ + array[i].name);

else if (array[i].transform.position > 0)

array[i].transform.forward = Vector3(1,0,0);

}

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

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

20 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

Related Questions

Show activity indicator in center of screen 0 Answers

whole animation not being played 0 Answers

Create Circular Motion to follow the object 2 Answers

colliders with touch 0 Answers

turn on off particle system 1 Answer


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