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 ComeSweetDeath · Feb 03, 2015 at 02:29 AM · movementrigidbody

How do I make my Player object move around as if it has high drag (with no sliding), but reacts to knock-back forces as if it has low drag (with lots of sliding)?

I'm trying to create this type of effect: http://youtu.be/v2uOGQegj2c?t=25s where, (1) while moving around, your character moves without any sliding (as if there is high drag), (2) when you get hit, your character reacts to the knockback as if it has very low drag, and slides around.

Any suggestion or advice would be appreciated!

Comment
Add comment · Show 2
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 ComeSweetDeath · Feb 03, 2015 at 02:39 AM 0
Share

Attempts: [1] I've tried one way of using Translate(translateDir), where the Vector3 translateDir= moveVector + knockbackVector3; This didn't work because the knockbackVector3 isn't counteracted by the moveVector, in the same way that rigidbody.Addforce counteracts rigidbody.velocity.

[2] I tried the straight forward rigidbody.AddForce(movement) for movement, and rigidbody.AddForce($$anonymous$$nockbackDir) for knockback. The problem with this is that they are affected by the same drag value on the rigidbody, so if I make the drag value low, both forces will cause the character object to slide a ton (rather than having just the knockback force causing the slide, and have the movement not causing any slide).

avatar image ComeSweetDeath · Feb 03, 2015 at 02:44 AM 0
Share

[3] I didn't have luck using the rigidbody.Addforce for knockback, and Translate for movement, the translate doesn't counteract the knockback.

So, atm, I still have no idea how to solve this. Please help! :c

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by FezAstron · Feb 03, 2015 at 02:50 AM

You can use rigidbody.AddForce(KnockbackDir, ForceMode.Impulse); or test out other force modes, there is ForceMode.Acceleration and ForceMode.VelocityChange

Comment
Add comment · Show 7 · 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 FezAstron · Feb 03, 2015 at 02:55 AM 0
Share

Unless you knew about those and tried them out.. :(

avatar image ComeSweetDeath · Feb 03, 2015 at 03:18 AM 0
Share

Yeah thanks Fez, I tried Acceleration and Velocity change. They didn't affect the sliding aspect unfortunately. They only affected how the force is applied to the rigidbody.

avatar image FezAstron · Feb 03, 2015 at 03:21 AM 0
Share

How about applying a physics material that makes you slide when you need it to slide and when the sliding time is over, make the physics material = null or back to the material you might have applied originally? I can help you with the code if you don't know how to change the material through code.

avatar image FezAstron · Feb 03, 2015 at 03:57 AM 1
Share

Well, the last thing I can offer you if rigidbody.$$anonymous$$ovePosition which moves the rigidbody just like transform.position except collider's work. I didn't see you mention trying it so just letting you know ;)

avatar image FezAstron · Feb 03, 2015 at 04:03 AM 1
Share

Oh and also, you can apply one physics material to it and keep it. Then when you need it to slide, you change the friction properties in that material. This way you keep everything default until sliding is needed, this way, no need to keep switching materials. Just an idea, do whatever you think is best. Good luck!

Show more comments

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

20 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

Related Questions

Moving rigidbodies at random 1 Answer

Implementing Counter-Movement 0 Answers

rigidbody friction problem....HELP!! 1 Answer

Stop A player Turning at Specific Point. 1 Answer

Very jerky camera movement with rigidbody 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