• 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 ghaddar0292 · May 14, 2013 at 03:29 PM · charactercontrollerparentchildplatformrotating

Making Rigidbodies the parent of character controllers is giving me problems.

Hi,

I am currently having two problems with the parenting script in a 2D platforming game.

1) I have a platform(rigidbody) that is floating and rising with the water level, and whenever the character is on the platform I would make the platform the parent of the character, so now the character will rise with the platform without falling of. But then I have another rigidbody falling on the platform causing it to rotate. Once the platform is rotating due to the physics engine, the character starts to rotate with the platform, and once rotated he would stay at an angle for the rest of the level. Any solutions to this problem?

2) I have wrote another script to make another platform to be the parent of the character. But for some reason if Im using both scripts, only one of them will do the parenting and the other script will not. And If I use only one, once I land on the second platform my character is following the position and rotation of the old platform. What is the reason for that and how to solve this issue?

Is there other ways to accomplish what I want to do?

Any help is very much appreciated. Thank you very much.

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
Best Answer

Answer by Kibsgaard · May 14, 2013 at 04:27 PM

1) In this case I don't parenting is the right solution. If you have not already, you should try out the "Character Motor"-script that comes with the standard assets package "Character Controller". It got code ready for handling platforms and sliding.

2) If the above works, this should not be a problem. In the future, for similar kind of questions, you should write the code from your scripts here.

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 ghaddar0292 · May 14, 2013 at 05:27 PM 0
Share

Thank you so much for the help. I did not know about the character motor. It worked fine as you said but now the character motor is affecting my character script controller. So I can barely jump now but I can move normally. I am using this script http://wiki.unity3d.com/index.php?title=FPSWalkerEnhanced as my controller. Any ideas how to get around this issue. Sorry about not posting my script previously.

Thank you again.

avatar image Kibsgaard · May 14, 2013 at 06:06 PM 0
Share

I think the FPSWalkerEnhanced-script is from before Character $$anonymous$$otor was a standard part of Unity. Try using Character $$anonymous$$otor and Platform Input Controller (modify this script to the axis your platform game is using). There is also a FPS Input Controller if that fits your game better.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

14 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

Related Questions

Make a simple tree 1 Answer

Moving Platforms & Scale (Parent/Child) 1 Answer

How to move your player with a moving platform (parent-child method not working). 2 Answers

Lerp a Child but 'keep up locally' with Parent 0 Answers

Why can't I set transform.position on a child object? 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