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 BTStone · May 18, 2012 at 01:22 PM · collisioncollidercharactercharactercontrollerbox collider

Character Collider doesn't collide with other Colliders

Hey there folks,

i got a little problem. I use a 2D Texture (with ex2D) as the player. That player has a CharacterController attached (for movement). The level has got some flat cubes (Box Collider). IF my character walks ON these cubes, everythings allright, he walks on them and doesn't fall, also the bool Method .isGrounded is set to "true". BUT as soon the Character walks IN a Box (in order to test the collision i put some random cubes on his way), he doesn't collide with the boxes, but goes just through them. But that shouldn't happen. He should just stop and isn't allowed to move any further.

Did i do something wrong or is there a problem with Character Collider and the other sorts of Colliders?

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

2 Replies

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

Answer by BTStone · May 18, 2012 at 03:51 PM

Actually i am using the translate-Method. I guess that's my mistake? The walls are not triggers and not layers colliding with the player's layer, that's for sure.

I looked up the .Move/SimpleMove-Methods at the Script-Reference(http://unity3d.com/support/documentation/ScriptReference/CharacterController.Move.html), it says at a certain point:

  moveDirection = Vector3(Input.GetAxis("Horizontal"), 0,
                             Input.GetAxis("Vertical"));
     moveDirection = transform.TransformDirection(moveDirection);
     moveDirection *= speed;



The point is, i am scripting for an 2D Plattformer-Game on iOS and i am using touches, so i can't use .GetAxis in order to do anything, i have to use my touches. How do i have to change the code in order to get it to work?

(Sry for the bad english, not a native speaker.)

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 Berenger · May 18, 2012 at 04:14 PM 1
Share

Yep, translate will modify the transform's matrix no matter what's around. $$anonymous$$ove / Simple$$anonymous$$ove apply a force in the direction you give them, which means the physic engine will simulate the movement to check if a collision occures before actually doing it.

As for your iOS question, I've never coded for mobile platform, but I guess it has something to do with the Touch struct.

avatar image BTStone · May 18, 2012 at 04:16 PM 0
Share

Allright, so i'll dig in the Touch-struct. Thank you for explaining!

avatar image
0

Answer by Berenger · May 18, 2012 at 03:25 PM

Are you using SimpleMove or Move to make your character walks ? Are you sure the walls aren't triggers and that they are not on a layer not colliding with the player's layer ?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

OnCollisionEnter not working 1 Answer

add camera collision without CharacterController 1 Answer

OnCollisionEnter Push Object Problem 0 Answers

How not to penetrate the walls? 3 Answers

How do I detect when two CharacterControllers collide? 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