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 timo0060 · May 07, 2012 at 07:06 PM · collisionrigidbodyplayer

Player goes straight through cube

As the the title says, I'm moving a player on a 2D sidescroller. I can jump and move left and right as well as jump. The player has a rigidbody and character controller attached to it. I then have one cube to test collision. The player goes through the cube, but can sit on top of it if you jump on it. the cube has a box collider and a rigidbody. Can any one solve my problem? If you don't get what I mean, here's a video to it: http://www.youtube.com/watch?v=Cegx8BOYxbk&feature=youtu.be. If you need more information on my problem, just ask.

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 FLASHDENMARK · May 07, 2012 at 07:21 PM 0
Share

Can you give us the script you use to move your cube?

avatar image Piflik · May 07, 2012 at 07:22 PM 0
Share

How are you controlling the left/right movement of the player? Directly via transform.position? If so, the player will ignore any collision.

avatar image GC1983 · May 07, 2012 at 07:25 PM 0
Share

What are you using to move your char? Char Controller script or translate?

avatar image timo0060 · May 07, 2012 at 08:14 PM 0
Share

// amount to move player amtTo$$anonymous$$oveH = (playerspeed Input.GetAxis("Horizontal")) Time.deltaTime; //move player horizontally transform.Translate(Vector3.right * amtTo$$anonymous$$oveH);

Then I use the character Controller to jump. The Jump is moveDirection

avatar image GC1983 · May 07, 2012 at 08:24 PM 0
Share

Thats why. Youre using translate to move the char left and right, use the char controller to do that as well. It ignores collision when using translate.

Show more comments

1 Reply

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

Answer by Piflik · May 07, 2012 at 08:17 PM

transform.Translate ignores collisions. Use CharacterControler.Move() or CharacterControler.SimpleMove() instead.

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Parent Object 0 Answers

Rigidbody collision/interaction 2 Answers

Player colliding with pickable object 0 Answers

Issues Making Character Move With Rigidbody 1 Answer

Player's hands passing through opponent while punching 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