• 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 Kitticid3 · Aug 18, 2018 at 01:16 PM · physicscontrollermovement scriptrelative movement

Relative Rigidbody movement,

The situation stands as follows:
1. This is my first post, and sorry in advance for any mistakes that I am sure to make.
2. My most recent FPS project now involves platforms, which pose an unexpected problem : The movement of the player has to be relative to platform it is standing on. Until now I used a modified version of drag, which acted only on the horizontal axis, and that had a substantial drag coeficient, to work proprerly.
The problem is that it is bound to the rigidbody's inertial frame of reference, working directly on the velocity vector. I now need to adapt said system to the friction between the player's rigidody and the platform, and modify the drag coefiecient dynamically to stop the player from accelerating ad infinitum.

3.Until now I tried the following:
3.1 having friction and the modified drag script. This was the initial situation.
3.2 friction only, drag negligable. The player, after is overtakes the static friction and the maximum dynamic friciton, accelerates ad inifitum. 3.3 a stepper function. simulation of steps by modifying the friciton coeficient, according to an internal timer. function as follows: float StepFunction( float x ) { if( x == -1 ) { return 1; } if( x > 0.75f ) {return x / 2.5f; } if ( x > 0.5f ) {return x /2 ; } if ( x > 0.25f ) { return x; } return 0.25f; }
x is the timer variable, which goes from 0 to 1; special case -1, triggered when the player changes input, touches a new platform, or jumps.
It kinda works, but the stuttering is quite visible, and it does not scale with the relative speed, and it is still prone to acceleration ad infinitum. 4. I would wish to not use the "parent-to-platform" solution, or the standard assets, because I want to understand how all this works.,

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

0 Replies

· Add your reply
  • Sort: 

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

157 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

Related Questions

Why is my character controller speed frame dipendent? 1 Answer

How to hit objects in VR 1 Answer

Unity3D HELP! How can i pickup/hold/throw object when im rolling ball? 4 Answers

How to control a sphere using thumb-sticks 1 Answer

How to use character controller to push down hinge joint properly 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges