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 sofiane13240 · Jul 08, 2012 at 09:29 AM · destroywheelcolliderremovewheel collider

[NEWBIE]How to destroy a WheelCollider ? (with a script)

Hello everyone, I'm new to unity, I'm running to create a game, everything goes well but I do not know how to remove a wheelcollider. Let me explain: In my game there is a bug, when I turn over my car, the wheel collider are multiplying like:

 //LeftFront_WheelCollider
     LF_WheelCollider(clone) 
     LF_WheelCollider(clone)(clone)
     LF_WheelCollider(clone)(clone)(clone)
     LF_WheelCollider(clone)(clone)(clone)(clone)
     ...

And that the execution of the game slowed considerably so my question is: How, through a script I could remove a WheeCollider?

My condition would be: wheelCollider if (clone) = true then destroy wheelCollider (clone)

But I do not know how to transcribe into his script and if it's the solution for my problem.

I've never coded in Java or C # or but I know lua coding.

I tried to write a script but it nothing happens.

   #pragma strict
 
 
 
 
 var LF_WheelColliders : WheelCollider;
 
 function Start(){
 }
 
 function Update () {
 }
 
 function destroy(other:Collider){
 if (LF_WheelColliders == true) {
     Destroy(LF_WheelColliders);
 }
 }


Thanks everyone

Sorry: Translation by Google

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 ProudOne · Jul 08, 2012 at 11:19 AM 2
Share

I think you should attempt to not create them in the first place so you don't have to remove them. Why are they being cloned? Are you adding them via code?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by sofiane13240 · Jul 08, 2012 at 04:02 PM

It's good, I just solved the problem thank you very much.

For people who have the same problem as me, the problem is WheelAlign (script) is not good, take WheelAligment_script that works wonders.

http://www.youtube.com/watch?v=DCKTLRZa8_E

Link in the description.

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

6 People are following this question.

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

Related Questions

destroy parent of script 1 Answer

Destruct gameobject by call from another script 1 Answer

DestroyObject is not destroying everything. 1 Answer

shuriken auto destruct script doesn't ALWAYS work? 2 Answers

Script to destroy object 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