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 ryft82 · Oct 07, 2014 at 11:17 PM · movementlerpsmoothinginertia

Inertia/Smoothing Advice

I'm relatively new to Unity and the languages as well, and have been having some issue trying to figure out how to get some form of smoothing applied to the following:

 transform.Translate(  Vector3.right * -Input.GetAxis( "Mouse X" ) * panSpeed );
 transform.Translate(  Vector3.forward * -Input.GetAxis( "Mouse Y" ) * panSpeed );

I've dug around online and here and in the scripting manuals, but everything I've found has either confused me more or applies to a completely different style of movement. I assume I need to cache the current transform, then apply the Translate and use a Lerp or some other form of smoothing between the two values, I'm just sort of at a loss as to how to even begin to start.

Any tips, advice, or pseudo-code or a point in the proper direction would be greatly appreciated. I apologize if this is the wrong way of doing this, but I'm just frustrated and would rather not waste more time searching for a solution. 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 Bunny83 · Oct 07, 2014 at 11:50 PM

MouseX and MouseY are delta values, so they reflect the direct movement during the lastframe and the current. It's difficult to smooth such values directly. It's easier to use an empty target object with your script above and let the actual gameobject follow that target object. For that you could use the SmoothFollow script from the standard assets or do your own smooth follow.

Comment
Add comment · Show 1 · 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 ryft82 · Oct 08, 2014 at 12:02 AM 0
Share

I see. I think that's ultimately what I was trying to ask, because either way there's some form of Lerp or smoothing that takes place between one transform and another basically, right?

I didn't necessary wish to smooth the $$anonymous$$ouseX or $$anonymous$$ouseY values, but the final product that those drive. I just don't know where exactly to begin. I wasn't aware that there was a Standard Asset for SmoothFollow, so I'll check that out and see if I can figure it out, but I'd still appreciate any advice if anyone else has further input. Thanks.

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

29 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

Related Questions

3 coroutines to ease in lerp, MoveToward steady pace, and ease out lerp 0 Answers

Movement Smoothing Script not Working 2 Answers

Smooth Camera/Object Movement 1 Answer

Make Lerp or other more fluid or continuous 3 Answers

The name 'Joystick' does not denote a valid type ('not found') 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