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 anildemir · Jan 15, 2014 at 08:09 AM · colliderboxcollidervibrationkick

Vibration when moving into colliders

Hi, I'm developing a 2D/3D mixture game where I have 2D sprites with box colliders standing and moving on their 3D environments. I figured out how to move the PC and change sprite animations but when I move into a collider which is a wall in this case, there is a vibration like it's trying to kick me back.

This is the video that shows the issue: http://www.youtube.com/watch?v=Izll396aFJw

These are my Physics settings:

alt text

Would be so nice if you could help me get rid of this problem. Thanks.

EDIT1: The problem kind of disappears when I change my Fixed Timestep from 0.01 to 0.008. It is not the solution of course but I may stay with it since I couldn't manage to control my character by velocity and addForce.

I use horizontal and vertical axises and give my vectors x and z values for it to move on horizontal space but the character hovers up. And also it doesn't seem to be moving xz or -xz directions.

By the way when I do it only on 2D it works and there is no vibration anymore.

q1.png (15.1 kB)
Comment
Add comment · Show 6
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 GameVortex · Jan 15, 2014 at 08:43 AM 0
Share

How are you moving your character? Remember that you can not use Transform.Translate to move GameObjects if you want them to be affected properly by collisions. This **tutorial ** shows how it moves a character around using a rigidbody ins$$anonymous$$d and changing velocities.

avatar image anildemir · Jan 15, 2014 at 08:48 AM 0
Share

I'm really new to Unity and C#, trying to learn much as I can. I have a Rigidbody and a Box Collider at the same time on my character. $$anonymous$$oving it by transform.translate. Probably that's the problem. Let's see if I can manage to do it. Thanks for the tutorial.

avatar image Sundar · Jan 15, 2014 at 09:04 AM 0
Share

Can you give 0.01 value for $$anonymous$$in Penetration For Penalty at your Physics Settings

avatar image anildemir · Jan 15, 2014 at 09:08 AM 0
Share

It gives the same result. I played around a lot with physics settings and couldn't find a solution. Only thing seems to fix it is changing Fixed Timestep from 0.01 to 0.008 but I know it is not a good way to do it.

avatar image GameVortex · Jan 15, 2014 at 09:15 AM 0
Share

Transform.Translate does not take collision into account and basically teleports the GameObject to the new position no matter what is already there. $$anonymous$$oving the Rigidbody as described in the tutorial I linked should solve your problem. =)

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by sarahnorthway · Sep 12, 2017 at 11:07 PM

Use rigidbody.MovePosition instead of transform.position.

 private const float speed = 14f;
 private void Update() {
     // includes wasd, arrow keys and controller sticks
     Vector3 moveDirection = new Vector3(Input.GetAxisRaw("Horizontal"), 0, Input.GetAxisRaw("Vertical"));
 
     // results in vibration:
     //transform.position += moveDirection * speed * Time.deltaTime;
     
     // no vibration:
     Rigidbody rigidbody = GetComponent<Rigidbody>();
     rigidbody.MovePosition(rigidbody.position + moveDirection * speed * Time.deltaTime);
 }
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

21 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

Related Questions

Tipping a cube over 2 Answers

A script that auto generated the box collider around a 3d model 3 Answers

spawn a ball in a football game 0 Answers

Collider closestPointOnBounds returning point that is not touching the collider 2 Answers

Nav Mesh doesn't detect doorframe 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