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 chesterman · Apr 13, 2012 at 10:57 PM · rigidbodycolliderscharacter controllerpassthrough

Character Controller vs moving platform

Hi all,

I have problem with using my player with characterController script taken from 2d Platformer Lerpz vs Moving platforms with rigidbody. The platform is moved by attached script in which I move the platform in FixedUpdate() function by these simple instructions:

 myRigidbody.velocity = direction * stepHeight * constantSpeed;

Now, there is situation like this, the Player runs towards a moving block/platform and collision is'nt well detected.

 P---><---B/P...

The Player just moves into this block! I am using on both sides functions like onCollisionEnter/Stay() but it still walks/jumps through those blocks/platforms. I have set box colliders and even tried with mesh colliders. This situation takes place only when both the player and the platform are going against each other. When they are going in the same direction, the collision works fine. My situation is like in 2d Platformer tutorial where the Lerpz can jump through opposite moving platform from the bottom of it. What am I doing wrong? Is there any healthy approach for controlling player and make him not to passthrough platforms from downside of the platform?

Comment
Add comment · Show 2
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 helios · Oct 08, 2012 at 06:33 AM 0
Share

Is there a solution to this? I am experiencing the exact same issue.

avatar image shaderop · Oct 08, 2012 at 07:16 AM 0
Share

Can you try lowering the relative speed of the player and the platform and then seen if that works? If it does work, then the easiest solution would be to use a bigger collider for your platforms.

This has to do with simulation quality and substeps, but I'm afraid I can't find a good summary of the subject. Basically, on one frame, your player and platform will be outside each other's colliders:

 P--><--B

But on the next frame Unity will update their positions based on their velocities, but because they moving so fast, they will already have gone past each other on the next frame, and no collision will be triggered:

 <--B P-->

That's my theory anyways. It could be that your problem is unrelated to all of this, and in that case, sorry.

0 Replies

· Add your reply
  • Sort: 

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

7 People are following this question.

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

Related Questions

Colliders Not Working 1 Answer

Navmeshagents, Character Controllers and Colliders 1 Answer

Small colliders go through objects 0 Answers

Is it new in Unity? Collider exception . . . 1 Answer

Multiple Colliders 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