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 pierro118 · Oct 22, 2012 at 01:50 PM · c#rotationcollisiongameobject

My marble (Player/Gameobject) goes through the "play board" (gameobject). Why?

Hello all!

I don't really like vague question, so here comes more detrails.

I have a marble that is moving around a board. The player has no control on the ball at all, though. What will make the marble move is the board and the gravity. The player rotates the board to move the marble around the maze. The board is moved by a script I programmed myself in C#.

My problem : When the marble is not moving anymore (completely stationary) and I try to move the board, the marble doesn't detect the collision at all and stay fix in the air until I move it manually myself in the "Scene" tab. Of course, I do not want that, it should always be affected by gravity and it should never go through the floor randomly.

My question : What is happening exactly and is there a way I can fix this little problem? It doesn't stop me from programming and testing anything else I want to implement in my game, but it's still quite annoying to go through the floor with no real logical reason.

I thanks you in advance for reading all of this and hope you can help me with this little problem.

Comment
Add comment · Show 3
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 MountDoomTeam · Oct 22, 2012 at 05:04 PM 0
Share

did you set the collider as continuous for the marble? Sorry I don't know! Your marble can bounce around with physics already? It has to do that at least then it should be okay, probably you are overriding the physics by having some transform position and function update? Otherwise the rigidbody should be running.

avatar image pierro118 · Oct 22, 2012 at 05:42 PM 0
Share

I tried, but it didn't change anything. I put it back at discrete for now. The marble can bounce around no problem and it moves, until it completely stop (on purpose on my side). When it stops, it doesn't move anymore, as if it was stuck in the air. I do not move the marble directly with the controls or with a script. Only the board is moving.

avatar image whydoidoit · Oct 22, 2012 at 08:52 PM 0
Share

Attach a kinematic rigidbody to the board. It sounds like you don't have one. This article has information on what you need to make a collision keep working and this from Unity discusses rigidbody sleeping.

1 Reply

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

Answer by Matt-Downey · Oct 22, 2012 at 10:26 PM

Try this and attach it to the marble, so it wakes up the rigidbody:

 function FixedUpdate()
  {
  rigidbody.WakeUp();
  }

Rigidbody.WakeUp:

There are settings in edit-->proj settings-->physics that control when a rigidbody falls asleep (min velocity, min angular velocity, etc) but they seem to glitch too often to be reliable.

Comment
Add comment · Show 6 · 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 pierro118 · Oct 23, 2012 at 02:35 AM 0
Share

This actually totally solved the problem I had. $$anonymous$$any thanks to you, $$anonymous$$att Downey. :)

avatar image whydoidoit · Oct 23, 2012 at 03:06 AM 0
Share

Did you have a kinematic rigidbody attached to the board and it wasn't waking up the ball?

avatar image pierro118 · Oct 23, 2012 at 04:13 AM 0
Share

The board does not have any rigidbody at all, only the ball has one. Also, the gameobject "board" is simply used as a parent to store all the others gameobjects that will be used to create the parkour/level layout.

avatar image whydoidoit · Oct 23, 2012 at 04:14 AM 0
Share

Well you need a rigidbody attached to anything that has a collider that operates with physics - not having one is a significant performance penalty and leads to the problem you were having.

avatar image pierro118 · Oct 23, 2012 at 04:15 AM 0
Share

Should I put the said rigidbody on the parent to save time? Or that won't work and I need to put one on every single element that are in the parent?

Show more comments

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

12 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

Related Questions

Flip over an object (smooth transition) 3 Answers

Issue with GameObject has been destroyed but it is not destroyed 1 Answer

C# Rotate GameObjects Regardless of List Size 2 Answers

How to Destroy a gameobject on collision 3 Answers

Make object only rotate in 90 degree increments 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