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 Jdogmaster · Apr 11, 2018 at 03:57 AM · colliderdestroycollidersdestroy objectpull

making objects react to colliders without tag C#

ok so i have a tornado that sucks up objects and rotates them around the tornado. the tornado has a few colliders each with a different amount of pullforce depending on how far it is from the tornado center. originaly i could make the tornado destroy objects by using objects picked up by the tornado using a collision script. so if my house is hit by the tornado with enough force it destroyes it. my tornado can only pick up objects with the tag of 'untagged'. my house has a script otherwise so it cant be picked up. but then if it his hit by an object with enough force, the house is replaced by a shattered version of itself, and all the shattered pices are tagged as 'untagged' so they are picked up by the tornado. but i want the tornado to also be able to destroy objects even if it hasent picked up any objects to throw at the houses. so in the tornado script there is pullstrength and in the house script there is durability. so i want if the pullstrength of a collider in the tornado is higher than a houses durability it will be destroyed. this is the portion of my script i made to just do that. there are no errors in it but it just isnt doing anything and i wasnt sure why it wasnt working. btw this isnt the full script. this is the script that goes on my house.

     public float Durability;
 private bool isCloned;
     void DestroyMe () {

         if (debrisPrefab && !isCloned) {
             
             Instantiate (debrisPrefab, transform.position, transform.rotation);

         }
         isCloned = true;
         Destroy (gameObject);
     }
 void OnEnter(Collision collision) {

     if (Durability <= collision.gameObject.GetComponent<TornadoVortex> ().PullStrength) {
         DestroyMe ();
     }
 }
Comment
Add comment · Show 6
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 PatrickDahlin · Apr 11, 2018 at 10:08 AM 0
Share

Please provide the code for the tornado since the way PullStrength or "objects thrown at the houses" is implemented isn't clear.

Also, please do some formatting for easier reading :)

avatar image Jdogmaster PatrickDahlin · Apr 11, 2018 at 12:59 PM 0
Share

ok i will send that

avatar image davidcox70 · Apr 11, 2018 at 11:51 AM 0
Share

You mentioned you want the tornado to be able to cause damage before it has picked up any objects. Does the tornado have a collider on it, or are there only colliders on the objects it picks up?

avatar image Jdogmaster davidcox70 · Apr 11, 2018 at 01:04 PM 0
Share

yes the tornado has multiple colliders in it extending from the center the tornado colliders use the tornadovortex code. if you want a clearer pickture of what the colliders look like around the tornado, watch this video https://www.youtube.com/watch?v=0kUX3P-If1E

avatar image Jdogmaster davidcox70 · Apr 11, 2018 at 04:00 PM 0
Share

Hopefully what I’m saying makes sence

avatar image Jdogmaster davidcox70 · Apr 11, 2018 at 11:46 PM 0
Share

so the tornado has colliders now what?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Jdogmaster · Apr 11, 2018 at 01:00 PM

here is the Tornado Vortex Script

     private GameObject PullOBJ;
 public float PullSpeed;
 public float objRotationSpeed;
 public float rotation;
 public void OnTriggerStay (Collider coll)
 {
     if (coll.gameObject.tag == "Untagged") {
         PullOBJ = coll.gameObject;

         PullOBJ.transform.position = Vector3.MoveTowards (PullOBJ.transform.position, this.transform.position, PullSpeed * Time.deltaTime);
         PullOBJ.transform.RotateAround (transform.position, Vector3.up, Time.deltaTime * rotation);
         PullOBJ.transform.Rotate (Vector3.left, 45 * Time.deltaTime * objRotationSpeed);
     }
 }
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

97 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

Related Questions

GameObject not destroying on Collision 1 Answer

Player falls through destroy collider 1 Answer

Sphere Collider not triggering scene reset on trigger,Sphere Collider not detecting collision on player 0 Answers

How to add avoid the script to overwrite camera collision? 0 Answers

Destroy instatiate object on trigger enter / collision,destroy instantiate prefab on trigger enter 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