Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 AntoPolizzi · Jul 07, 2015 at 05:54 AM · through

player passes through enemy

Hi people, in my scene i have 2 object the player and the enemy. the player and the enemy have a lot of child and every child have a lot of child. every child have a box or spere collider. the player and the enemy have a rigidbody(no gravity and kinematic) My question is why player passes through enemy ?? how i can evitated this?? Note:i move and rotate player and enemy using transform.position and transform.rotate

Comment
Add comment · Show 2
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 Vice_Versa · Jul 07, 2015 at 06:40 AM 0
Share
  1. if you have isTrigger checked on for any of the colliders (on the parents) turn those off

  2. if that didnt work try turning off is $$anonymous$$inematic

  3. if neither of the above work, you might have to set it up in a script, use the OnCollisionEnter method or the OnTriggerEnter function

avatar image n1gth · Jul 07, 2015 at 06:42 AM 0
Share

Plus check in Edit -> Project Settings -> Physics that the Layer Collision $$anonymous$$atrix is set up so that different layers collide with each other properly.

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by FaizanDurrany · Jul 07, 2015 at 09:50 AM

Hello AntoPolizzi

the problem you have is that you are using transform.position and transform.rotate to move objects. you are actually changing the object's position in the world coords which means it will ignore any physics. it is just like moving objects from within the editor. if you have rigidbodies attached to both, the player and the enemy why not use Rigidbody.AddForce?

if you still don't want to use Rigidbody.AddForce then you can also use CharacterController. there are some really good tutorials on youtube for moving the player.

if u still dont get it i am happy to explain more.

Regards Faizan.

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 AntoPolizzi · Jul 07, 2015 at 04:43 PM 0
Share

Hi tnx =) I usually don't use rigidbody becouse i can't regolate the exact position of the object XD, and i am so weak to use it. Now i try to use it using a tutorial.

avatar image
0

Answer by ccjbn · Dec 05, 2018 at 03:07 AM

I had a similar problem. In my case it seemed as though the vector3, which I named movement, I used to make changes in the x and y coordinates was bringing the objects back to it's settings after being pushed. I put movement = transform.position; at the beginning of my UpDate() method, before my If(Input...) conditions. That way the actual position matched the vector3 position I was going to manipulate.

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
0

Answer by samra2494 · Dec 20, 2019 at 07:02 AM

Hope this help u..

https://answers.unity.com/questions/537366/prevent-a-character-model-to-pass-through-another.html

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

Collider break through? 0 Answers

Player(box) randomly falls through objects. 1 Answer

UI - click through image 2 Answers

Falling through the floor issue 11 Answers

Camera go through the wall, help! 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