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 Nicolinux · Nov 08, 2011 at 05:14 PM · physicsrigidbodyboxcollider

Box Collider z Axis unwanted reset

I have a simple plane (created with 2D Toolkit) and I'd like to limit the movement of that sprite in x direction. I have created a cube with a rigidbody and a box collider. I did the same for the sprite. However upon play the size and z-axis of the box collider automatically reverts to z:-100000 and size 0,0,0. How? Why? Where? Is this intended behaviour? There are no scripts that change these values.

Thanks.

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

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by glong · Nov 17, 2011 at 08:50 PM

I have the same problem. It seems to work fine when I use certain sprite collections, but the problem returns when I use the collection I need to use, or when I use a newly created sprite collection. I tried to remove and reload the tk2d sprite component, and the collider component disappeared entirely. This seems to be some sort of Tk2d bug. Let me know if you make any headway.

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 Sonaten · Nov 28, 2012 at 08:47 AM 0
Share

You should use the comment feature for stuff like this.

avatar image
0

Answer by Nicolinux · Nov 18, 2011 at 03:13 AM

I worked around it by creating a cube with and added the sprite as a child to it. Then disabled the mesh renderer for the cube to make it inivisble. There I added a rigid body and restricted the movement. Since the sprite is attached to the cube, it follows the restricted movement. Another odd thing I noticed regarding this issue is that when I have two objects add a box collider, set "IsTrigger" and add a rigid body, then the objects do not collide but fall through each other.

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 glong · Nov 18, 2011 at 07:47 AM

Thanks. I will try some creative object parenting, though I still find it very frustrating that I can't have both a sprite and a collider on the same object, especially since I had it working before doing the latest TK2D update.

As for the "IsTrigger" issue, that is an intended behavior. That option is for when you want a collider to not be a physics collider, but instead be just a trigger for game events. Useful for making waypoints, powerups and such.

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 Sonaten · Nov 28, 2012 at 08:47 AM 0
Share

You should use the comment feature for stuff like this.

avatar image
0

Answer by KeirMeikle · Dec 01, 2011 at 02:48 AM

In your sprite's collection, make sure Collider Type is set to "Unset"

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 Nicolinux · Dec 01, 2011 at 12:30 PM 0
Share

I did now but z still reverts to -10000 upon play.

avatar image
0

Answer by dethmuffin · Oct 03, 2012 at 11:40 PM

Make sure that after you set the Collider type to "Unset", that you delete and re-add the box collider and rigid body to your sprite. That fixed it for me.

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

6 People are following this question.

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

Related Questions

Wheel Collider - Mesh/Box Collider Problem 0 Answers

Adding real life physics behavior on 3-d object. 1 Answer

Character with box collider sticks to walls 0 Answers

Why do I get OnTriggerExit upon collision when a rigidbody is kinematic? (example) 3 Answers

Apply Gravity to Car Physics 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