Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Aleks_Gavs · May 13 at 09:17 AM · colliderschild object

Object passes through childrens' boxcolliders

I have a box which consists of 5 children cubes. Each cube has box collider.

When I have sphere in this box, and move the box, sphere passes through the "walls" (children cubes) of the box. If I move the box really slightly, the sphere "sees" colliders and reacts accordingly. But if the speed of moving is bigger, sphere just passes through.

It seems that collision detection must be switched to Continous, but I tried it and it didn't work. Sphere has sphere collider and rigidbody.

I tried a lot of things already: - changed collision detection on sphere to all options; - hanged collision detection on cubes to all options; - added and removed rigidbodies on cubes; - OnTrigger is off for each of them.

Looks like I've tried all possible combinations of rigidbodies and collision detection. Please, help.alt text

безымянныи123.png (22.1 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 TheIrishKraken · May 16 at 03:50 AM

I don't know what code your using so this is just a guess. Have you put your game logic inside Update or FixedUpdate ? Any physics related code is best put in FixedUpdate to best calculate collisions.

Comment
Add comment · Show 1 · 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 Aleks_Gavs · May 16 at 05:29 PM 0
Share

It's not about game logic. It's a simple scene with 12 spheres above the box (the link is below). When I start game, they all fall into the box (Gravity is on). Then I move the box left and right, and while moving it, the spheres get out from it through the walls of the box. The moving script is simple (it's below).

The scene is educational one, I downloaded it from Unity educational pathway: https://learn.unity.com/tutorial/counting-prototype?language=en&labelRequired=true&pathwayId=5f7e17e1edbc2a5ec21a20af&missionId=5f7648a4edbc2a5578eb67df#

I already finished this task (used non-tansparent walls and destryable spheres when they are in) but still I'd really appreciate if you can help me for future projects because I spent about 4 hours to solve the problem and still couldn't =(

The moving script fro box is simple: public void Update() { if (isActiveGame) { horizontalInput = Input.GetAxis("Horizontal"); transform.Translate(Vector3.forward boxSpeed Time.deltaTime * horizontalInput); } if (transform.position.z >= zAxisConstraint) { transform.position = new Vector3(transform.position.x, transform.position.y, zAxisConstraint); } if (transform.position.z <= -zAxisConstraint) { transform.position = new Vector3(transform.position.x, transform.position.y, -zAxisConstraint); } {

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

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

Untouchable child objects of first person controller 1 Answer

Character change is not working 0 Answers

Issue with child object collider moving through other colliders 1 Answer

Animation of missing Child Object, not missing anymore at runtime 0 Answers

Enemy Trigger Colliders are triggering my player's trigger collider. Why? 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