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
1
Question by Stending · May 20, 2014 at 10:26 PM · 2dcollider2d

[2D] Bug ground collision

Hi! I'm beginning with Unity, and I tried to do a base for a platformer game, in 2D. I just have a caracter moving to left and to right, and he can jump.

I use some "blocks" to do the ground.

My problem is here : My caracter moves perfectly, but sometime, he stop moving at the intersection of two blocks. I don't understand why, my blocks are perfectly aligned.

Someone know why? Thanks in advance!

(Sorry for my bad english)

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 ivomarel · May 20, 2014 at 10:49 PM 0
Share

It helps if you post some code.

avatar image kamgru123 · May 20, 2014 at 11:03 PM 0
Share

I'd check the colliders. But without any code it's really hard to give you any help.

avatar image Stending · May 21, 2014 at 09:42 AM 0
Share

Here's my only script, for my caracter :

 using UnityEngine;
 using System.Collections;
 
 public class PlayerScript : $$anonymous$$onoBehaviour {
 
  public Vector2 speed = new Vector2(0,0);
  public Vector2 movement = new Vector2(0, 0);
 
  void Update()
  {
   float inputX = Input.GetAxis("Horizontal");
   bool jump = Input.GetButtonDown("Jump");
   speed.x = inputX * 10;
   if (jump)
     speed.y = 10;
   else 
     speed.y = rigidbody2D.velocity.y;
   movement = new Vector2(speed.x, speed.y);
   
  }
 
  void FixedUpdate()
  {
   rigidbody2D.velocity = movement;
  }
 
 }

I thought the problem didn't come from this, that's why I didn't post it.

avatar image hamstar · May 21, 2014 at 09:52 AM 0
Share

I'm not sure if this works for 2D physics or just 3D, but perhaps you could test it. I think Unity still need to add an equivalent setting to 2D. Try changing $$anonymous$$in Penetration for Penalty to 0 in Edit > Project Settings > Physics.

avatar image Stending · May 21, 2014 at 10:25 AM 0
Share

I think I found the problem! $$anonymous$$y caracter only had a box collider. I added a circle colider for his feet, and it works!

Thanks for all! (What I have to do to make my question "Solved"?)

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Stending · May 21, 2014 at 06:20 PM

I found the problem! My caracter only had a box collider. I added a circle colider for his feet, and it works!

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 hamstar · May 22, 2014 at 07:10 AM 0
Share

If you are happy with your answer, please click the "tick" to the left of your answer to accept and close the question.

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

24 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

Related Questions

Using child colliders with rigidbodies/joints in 2D 0 Answers

Problem with method Collider2D.isTouchingLayers() 4 Answers

Find next corner of a 2d pollygon collider 0 Answers

Character jittering when moving and constant back and forth when colliding. 1 Answer

Same script on two gameobjects, only the original(first) one is working 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