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 sombra · Feb 05, 2013 at 08:51 PM · character controllermoving platform

Character Controller falls when over Moving Platform

I know that there's a lot of questions about this topic in the forum but none of them actually helped my. Besides, there's a lot of posts saying to look the 2D tutorial but it seems unable now...

The question is: I have a character controller with a BoxCollider (triggered) and I want to make it stay over a floating platform while moving. The platform is a kinnematic rigidbody.

I've already tried to use OnControllerColliderHit to recieve the speed from the platform and apply it to the player but then my character seems not to move at the same time as the platform. Also I've tried parenting player's translate with platform's translate (using OnTriggerStay) but I wasn't able to do this too.

Can anyone halp me with this problem?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by FL · Feb 06, 2013 at 12:05 AM

I also had problems with this, but finally manage to make a moving platform and an elevator working.

You can't do this with a Trigger (only if you have a bigger platform collider as trigger and a child object with actual platform). If you don't use Trigger, have both (platform and player) with rigidbodies and colliders.

Disable platform gravity. Make sure that OnCollisionEnter or OnTriggerEnter are called in contact.

Creates a private empty array. In Start(), put this object in this array. In OnCollisionEnter/OnTriggerEnter add every collision/collider object that have a character controller and/or rigidbody to this array. In OnCollisionExit/OnTriggerExit, remove the object in collision/collider of the array. In Update (I recommend FixedUpdate), for every object in this array, call the line object.transform.position += distanceVectorPerUpdate, this variable can be something like Vector3(0,0,1).

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

Answer by Spy-King · Nov 01, 2015 at 01:27 PM

This video will help you.

https://youtu.be/t6Xr6iRMWII

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

10 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

Related Questions

How to get a character to stay on a moving platform? 3 Answers

Can´t get the character to Stay on a moving Platform 1 Answer

Why is this happening? (gif attached) 2 Answers

Character Controller and Moving Rigid Bidy 0 Answers

How to Instantiate objects randomly within the space of another moving object? 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