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 coen22 · Jan 20, 2014 at 11:03 PM · collision

Rotation collision problem

Hey,

I'm make a 2.5d platformer and I'm created some rotating blocks alt text see the block at the left, it's rotating around the z-axis. The problem is that when the block rotates, the box collider is going through the player, which causes it not to detect any collisions and then the player just falls through the object.

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 Exalia · Jan 20, 2014 at 11:06 PM 0
Share

I'm slightly confused so if your player character is standing on the rotating block it just falls through?

or is it that the player cannot stand on the block at all because it is rotating?

avatar image Exalia · Jan 20, 2014 at 11:22 PM 0
Share

I'm just gonna throw some random things at this as I don't know enough about whats going on in your game to say anything otherwise (hint hint, please post some code if you can :))

  1. are you calculating physics in FixedUpdate?

  2. check the box isn't a trigger

  3. check the box has a collider

  4. check the player has a rigidbody

  5. check the player has a collider

avatar image coen22 · Jan 21, 2014 at 02:35 PM 0
Share
  1. no

  2. no it's not like that

  3. I said it had a box colider

  4. I use a character controller, why would I need a rigid body?

  5. the character controller also has a collider

I can stand on the block, just for a second.

sorry should've posted my code (to make it more clearly): https://www.dropbox.com/s/ew0izrkeq3p43xf/PlayerControlTwo.cs

I use OnControllerColliderHit for the vertically moving blocks

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by HappyMoo · Jan 21, 2014 at 03:01 PM

You most likely rotate something directly, that the physics engine doesn't expect you to rotate/move directly. Is that block kinematic?

See this video for details: http://www.youtube.com/watch?v=WFkbqdo2OI4

Comment
Add comment · Show 5 · 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 coen22 · Jan 21, 2014 at 04:26 PM 0
Share

but how can I rotate it without doing it directly? I know I can add forces but that doesn't create a rotation with a constant speed

avatar image HappyMoo · Jan 21, 2014 at 05:14 PM 0
Share

You watched the video?

avatar image coen22 · Jan 21, 2014 at 06:50 PM 0
Share

yes I did. But it doesn't explain what I need to do

avatar image Ferb · Jan 21, 2014 at 07:00 PM 0
Share

I agree with Happy$$anonymous$$oo, that's probably the solution. To rotate it indirectly at constant speed, you'd need to give the block a rigidbody, cancel gravity etc. on it, give it a very high mass relative to the player so the player doesn't affect its rotation, then just set the angularVelocity component of the rigidbody. And set the angularDrag to 0 so it keeps rotating at constant speed.

avatar image HappyMoo · Jan 21, 2014 at 09:42 PM 0
Share

Set the rigidBody to kinematic, then you should be able to manipulate it by its Transform.

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

21 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

Related Questions

place a object on the position where the object is colliding with the terrain. 1 Answer

Want to use iTween for 2d floor collision. 1 Answer

Physics Collision problem(when ball enter to next ground) :( Seeking for solution from more than 1 month 1 Answer

Get child tag from parent-child collision 1 Answer

reset level on collision 3 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