• 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 BOzard · Mar 18, 2013 at 02:59 PM · c#2dcollision

Moving objects upwards in unity's editor-window, moves the same object automatically further on z-axis

Hi,

I t$$anonymous$$nk the topic explains itself.

I'm creating a 2D JnR. Main Camera is Orthograp$$anonymous$$c.

The Collision works just fine so far as long as the z-position of my blocks (on w$$anonymous$$ch the player can stand) is between ~ -0.5 and 0.5. I put all blocks in a folder in the scene-$$anonymous$$erarchy. The first (or origin) block was created with z position 0. All dublicated blocks on screen have the same properties, until I move them upwards (or downwards). Moving upwards increases the z position. And vice versa. Not proportional, only a little bit. But when a block reaches a certain height, z-position is 0.5. With these blocks, the player won't collide.

I could fix t$$anonymous$$s by either putting a script on the specific blocks that lock the z position to 0 or adding some code to the collision query (like -> collide also when transform.position.z+1f) or somet$$anonymous$$ng.

Both solutions would work. I tested them. But I guess both implementations are dirty work. I'd rather know the reason of t$$anonymous$$s strange behavior and fix it, so that I can place the grap$$anonymous$$cs wherever I like (with z = 0, always). Any ideas?

Thanks in advance!

EDIT:

Well, unfortunately, I can't provide any screenshot or video (confidentiality issues) of the current project. I'm trying to find a way to show it with another project/grap$$anonymous$$cs later (or tomorrow). But I don't really t$$anonymous$$nk that it's necessary. At least in order to understand what i'm doing.

short summary: moving Grap$$anonymous$$cs/GameObjects (with the mouse) in scene-view (in order to place them to a position I want them to have)

unwanted side effect: z position changes.

By moving them upwards (or increasing Y) z slightly increases, too.

What I forgot to mention is that the z-value jumps back after I try to manually enter "0" in Inscpector->Transform Position->Z and apply it.

But the spinners are set to Y and X only. Moving the object upwards only by the y-arrow doesn't work either.

I believed it has somet$$anonymous$$ng to do with wrong settings or so (w$$anonymous$$ch I could post here of course. Any suggestions?).

Comment
Add comment · Show 1
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 nsxdavid · Mar 18, 2013 at 04:07 PM 0
Share

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by robertbu · Mar 18, 2013 at 04:20 PM

If you are doing what I t$$anonymous$$nk you are doing, you can drag by clicking on the end of an arrow rather than dragging on the object itself. For example by draging on on the green arrow your object will only move on the 'Y' axis. You can click on the spinner in the upper right corner of the scene view to change how you are looking at the scene making it easier to move only on a specific axis. If you have the spinner set to 'Y' up, and 'X' right or left, then if you drag directly on the object, you will not move on the 'Z' axis.

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 BOzard · Mar 18, 2013 at 04:30 PM 0
Share
avatar image robertbu · Mar 18, 2013 at 04:57 PM 0
Share

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

11 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

Related Questions

How to Check if any Children of a GameObject are in a specific area.,Check if a position contains a GameObject or children of a GameObject 1 Answer

destroying gameobject from other script 1 Answer

2D collision detection / box intersection WITHOUT physics 2 Answers

How do I set bounce to set amount 1 Answer

[C#]Collision whit lava kills player (Unity2D) 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