Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by SebastianOsborn · Jun 13, 2019 at 01:39 PM · player

How to get the player to rotate with a rotating platform?

So to get started, let's address to the two pictures.

One picture shows my scene with the player on a checkerboard base and next to him is a platform that is spinning (which I accomplished by simple keyframe animation in Unity). That platform is the one I will be referring to for the rest of this post.

The other picture shows my script that is attached to the platform. I've seen this script a few times in my search for help.

Note: I am using the most recent version of the Standard Assets pack you can import from the Asset Store for my first person player, which you can see in the Hierarchy on the left in the picture of my scene.

So, the script works and obviously whenever the player is not on the platform, he is not parented to it. But whenever he is on the platform, he is parented to it. So here's my first problem: The moment the player lands on the platform and collides with the trigger box (and thus is parented, because of the script), something strange happens to his rotation. The player's rotation just jerks to a different direction. The same thing happens when he jumps off the platform (and thus is no longer parented), his rotation jerks again to a different direction. It seems like when he jumps off the platform, the rotation he had before jumping onto the platform returns to him. But either way, if you were playing a game like this, you would expect the rotation of the player to stay the same when landing and jumping off of the platform. But this is not the case.

Here's my second problem: Whenever the player is on the platform, although his position and rotation is the same as the platform, he is sliding back and forth slightly for some reason. It's like there's a misalignment issue or something causing him to move around while on the platform.

What's sad is that a long time ago when I used an earlier version of Unity to make a parkour game, the Standard Assets came with some JavaScripts, and one of them (or maybe more than one of them) prevented these issues from happening. But because Unity no longer uses JavaScript, and no one has recreated this stuff exactly the same way in C+, I don't know what to do.

So please, the game I'm making has a lot of mechanics that involve jumping onto different types of platforms, and spinning platforms is one of them. It is absolutely vital that I can get this game mechanic to work. And please, I'm not a scripter, so please don't just only show a few scripting words or a variable name. I need someone who can create a whole script that fixes both of these issues. If you could post that full script, I would greatly appreciate it! And please explain in detail what I need to do. Thanks!

Note: And, yes... I know this question has been asked before, but I've had no luck looking at all those other posts so please don't direct me to them. This post needs to be fresh and provide an answer to not only me, but those who come after me, looking for answers and can find them on this post. Thanks.alt text alt text

the-script.png (46.7 kB)
the-scene.png (384.6 kB)
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 InfernalMajesty89 · Nov 06, 2020 at 08:14 PM

i hope you've figured this out by now but Problem 1: Make sure your player's default transform identity is zeroed out. You can do that in script when they become parented but this might cause a blip on screen, better to do it before compiling.
Problem 2: Set rigidbody collision checking to continuous or continuous dynamic in the Inspector.

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

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

Related Questions

player skin help,player skin same on ether side. 0 Answers

How do I change the transform position of my player when it reaches a certain x-position? 2 Answers

How to reset airplane's position once they crash into any part of the terrain?,After plane crashes, reset the player's position? 0 Answers

Launchers for Players 1 Answer

Top Down Character - Face direction of movement? 0 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