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 CydonianKnight · Feb 23, 2013 at 01:56 PM · moving platformslidingtrain

How to prevent Character Controller from sliding during riding an animated platform?

Hello guys,

in my game I have a train which the player is supposed to ride in order to get from one station to the next one. I put a locomotion and several waggons as child objects to one empty game object which I animated within Unity, using the legacy system, to move between the stations. The player is able to enter the locomotion and should be able to move around within the vehicle. However, when the train moves the character controller is first sliding against the movement direction and then back agains towards the moving direction. In the end, when arriving at the second station, the player is back at his original place. Not sure if it's really sliding or if the player is simply moving slower than the train in the first part of the ride respectively faster in during the second one. The train elements all have colliders attached and no other components. I haven't added any components to the Character Controller. Also, when the player jumps he falls off or through the train onto the track. Disabling the sliding property on the Character Controller didn't have any impact on the issue. I have similar problems with an elevator. I assumed moving platform support to be included and working more or less on its own without having to manually tweak things and I can't really figure a way to make it work. I also tried parenting the locomotion to the player for the time of the ride but when doing so the Controller is kind of forced to a position and not able to move until the animation has finished. I hope you guys can help me with this issue. Do I have to add some components (rigidbodys?)? I know there are several posts on moving platform stuff around but I didn't have any success with these. Many thanks in advance!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ddmx · Feb 23, 2013 at 06:48 PM

You'll need to make sure that the character's velocity profile is computed as relative to the object he's standing on. When he's on a stationary platform it's easy. When the platform is moving his zero velocity now becomes that of the platforms. Anything on top of that like movement for instance is now charVel+=trainVel

Hope that helps.

Comment
Add comment · Show 2 · 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 CydonianKnight · Feb 24, 2013 at 01:36 PM 0
Share

But shouldn't that already be included out of the box within the character motor script of the standard character controller? I looked at the script and there is already code there that takes care of adding the velocity of a moving platform to the controller's own velocity.

avatar image Chronos-L · Feb 24, 2013 at 02:00 PM 0
Share

I think that you still have to assign the platform variable of the controller using another script for the out-of-the-box script to work(or you can extend the ready-made script, whichever way that floats your boat). Last time I check, the out-of-the-box script apparently do not check the type of surface the character is standing on.

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

11 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

Related Questions

Player rigidbody slides off moving platform -1 Answers

Advanced collisions: mesh collision? 0 Answers

Fps controller physics 2 Answers

How to slide a character in temple run like game? 1 Answer

Unity 5: Mecanim/Animator-Driven Collision No Loner Sliding Along Walls 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