Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Fixel001 · Aug 26, 2020 at 10:59 AM · movement2d gamecharacterwall

2D character bounce off wall / shakes while walking into it

First off i'm new, my character keeps bouncing off the wall when i run into it and makes the camera all shaky, sometimes it even walks through it if the speed of my character is enough.How do i fix it, explain in simple form pls XP.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
-1
Best Answer

Answer by Fixel001 · Aug 27, 2020 at 03:19 PM

Solved ..... should not have left using UnityEngine; alone .. there are two more (using) codes up there at the top and i assumed its useless :( .... suffered allot of mental illness and 2 days of my time because i delete them and i'm the one to blame.

Comment
Add comment · Show 2 · 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 Fixel001 · Aug 27, 2020 at 03:22 PM 0
Share

the rest i can just follow these steps https://www.youtube.com/watch?v=Cry7FOHZGN4

avatar image mephistoII666 · Aug 28, 2020 at 09:17 PM 0
Share

please PLEASE UN$$anonymous$$ARK this. This is NOT the right answer to your problem, and in fact this is horrible advice.

System.Collections and System.Collections.Generic are the libraries including .net's lists and dictionaries. They have nothing to do with physics collisions.

Unnecessary imports DO NOT improve your code's health at all.

I reiterate, please UN$$anonymous$$ARK this as the right answer. This is HORRIBLE advice.

avatar image
3

Answer by YasinJavaid_ · Aug 26, 2020 at 11:10 AM

Hi, Add rigidbody to you character and freeze its rotation constraints those that are shaking.

see image bellow. alt text


screen-shot-2020-08-26-at-40740-pm.png (53.7 kB)
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
avatar image
2

Answer by mbro514 · Aug 26, 2020 at 02:13 PM

Try setting the collision detection of your rigidbody to "continuous" rather than "discrete".

Comment
Add comment · Show 4 · 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 Fixel001 · Aug 27, 2020 at 02:11 PM 0
Share

https://www.youtube.com/watch?v=LoxXpmJ4BlQ this is the problem the video tryed to fix but i cant seem to follow through because the different ways we used to make our character move. This is my code: using UnityEngine;

public class $$anonymous$$ovementPlayer : $$anonymous$$onoBehaviour { public float moveSpeed; void Start() { moveSpeed = 3f; }

 void Update()
 {
     transform.Translate(moveSpeed * Input.GetAxis("Horizontal") * Time.deltaTime, moveSpeed * Input.GetAxis("Vertical") * Time.deltaTime, 0f);
 }

}

avatar image mbro514 Fixel001 · Aug 27, 2020 at 03:03 PM 0
Share

So, the problem is that you're moving the transform directly, rather than adding forces to your rigidbody in order to modify the transform.

Try using the Rigidbody.AddForce() function.

Just a side note: I noticed that you're making a 2D game, but you're using a non-2D rigidbody. For performance reasons, it would be best to use a Rigidbody2D and 2D colliders.

avatar image Fixel001 · Aug 27, 2020 at 03:26 PM 0
Share

dude thank you for all your wonderful replies :) fixed it after more than 2 days of brain washing. Anyways thank you again <3 turns out deleting two of the (using ) code at the top is a BIG mistake ... the rest is covered in the vid :D

avatar image mbro514 Fixel001 · Aug 27, 2020 at 05:20 PM 0
Share

You're welcome! I'm glad that you managed to solve your problem.

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

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

How to remove blur when moving 2D objects 1 Answer

Making a character move automatically in one direction. 2 Answers

counting seconds that character is idle. 1 Answer

Moving a 2D Object a certain distance over time with a single button click 1 Answer

Problem getting players position. 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