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
1
Question by noahg1 · Jan 13, 2013 at 07:10 AM · movementphysics

Player falls through rising platform?

I have a platform in my scene that is made of a cube with a box collier. It rises and falls through out the game. When my player stands on it it collides normally with the surface and can move around as it should,however, when the platform rises, the player falls through the platform. I find this curios as the physics is as it should when the player jumps. How do I fix this so that the player can rise and fall with the platform?

Comment
Add comment · Show 4
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 darthbator · Jan 13, 2013 at 09:18 PM 0
Share

How are you moving the platform? This seems to be a really strange thing, but I've found that if I move something touching another object by directly modifying it's transform.position it will ignore collisions in many cases and move DIRECTLY through things. However when using transform.Translate or when moving an object using physics or directly acting on it's velocity that doesn't ever seem to happen. $$anonymous$$ight be something worth looking into!

avatar image noahg1 darthbator · Jan 13, 2013 at 11:26 PM 0
Share

thanks for you ideas. I am currently using what is probably not the best method, I am making the trasform.position = Vector3.Lerp(start, end, t) and effecting t in order to move the platform up and down. I tried the translate it doesn't make a difference.

avatar image FlashX · Nov 22, 2013 at 01:40 AM 0
Share

im having the same problem, did you end up fixing it?

avatar image noahg1 FlashX · Nov 22, 2013 at 02:12 AM 0
Share

Yeah, I ended up putting a using Character Controller and the Character $$anonymous$$otor script from the Standard Assets. Works like a charm now. Good Luck!

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Zarenityx · Jan 13, 2013 at 09:32 PM

If you are translating or using an animation, it is bound to mess up the physics. What I often do is to make the moving platform a kinematic rigidbody, then animate or alter in code the velocity. This should collide with rigidbody and character-controller players, but players that translate probably won't work. If you are using a rigidbody, try using continuous collision detection to prevent it from slipping through. With this method there is no need to check collision in a script.

Comment
Add comment · Show 3 · 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 noahg1 · Jan 13, 2013 at 11:38 PM 0
Share

Thanks I tried animating it, it seemed to work for a few seconds and then the player just fell through, I also tried altering the velocity but i think I may be doing that wrong as it raises for a sec but then the platform drops. Not sure why perhaps the player is too 'heavy'?

avatar image Zarenityx · Jan 16, 2013 at 09:07 PM 0
Share

Are you setting the velocity in code? If you are, it is probably doing it once, causing the platform to fly into the air, but then drop again, because there is nothing holding it up. $$anonymous$$y suggestion would be to make an animation animating the rigidbody.velocity, and be sure it looks somewhat like a sine curve- with part of it positive and part of it negative. Set it to loop and it should constantly cause the platform to move up and down.

Note: If you are going to create a script that disables this animation for optimization purposes, be sure to disable the rigidbody too, or it will start falling again.

avatar image oronbz · Jul 13, 2020 at 09:18 AM 0
Share

Thank you so much, I have no idea why it works, but it solves the issue!

avatar image
0

Answer by cdrandin · Jan 13, 2013 at 08:39 AM

There are 2 ways I can think of solving this. When your platform is rising match the platform speed and add it to your y velocity to have the player move up as well or you could parent the player to the platform in which the movements are independent of one another. http://docs.unity3d.com/Documentation/ScriptReference/Transform-parent.html

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 noahg1 · Jan 13, 2013 at 07:01 PM 0
Share

I have tried parenting it, but when i get the collision detection, I fall pass through the object no matter what. I just found out that if the player is moving while the platform rises, then the player will rise with it. I only fall through while the player isn't moving. Is this not odd?

Thanks for your reply, I can try the transform but i have the issue of checking collision....

avatar image
0

Answer by robertbu · Jan 13, 2013 at 09:48 PM

Two ideas: perhaps your character is going to sleep, or the relative difference in speed is great enough that your character passes through the platform before the collision registers. My bet is sleep. You can test both by going to Edit/Project Settings/Physics. You can set the sleep velocity to 0 to test for sleep. You can up the Solver Iteration Count to test for velocity issues. Note sleep velocity can be set by script on an object by object basis, so you don't have to set it to 0 for your entire project.

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 noahg1 · Jan 13, 2013 at 11:39 PM 0
Share

thank you I tried both of these but neither produced anything that pointed to a solution but its very helpful for future reference. Thanks again.

avatar image
0

Answer by gkamgul · Oct 28, 2017 at 03:41 PM

I assume that your platform adding force to player while going up and player lost it's balance.try to constrain rotation.

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

15 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

Related Questions

RigidBody2D Movement Stuttering 3 Answers

Why are these object passing through each other? 1 Answer

Non slippery movement 1 Answer

Update speed and physics makes my rigidbody jiggle 2 Answers

Move armature rigidbody character 2 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