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 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 think the topic explains itself.

I'm creating a 2D JnR. Main Camera is Orthographic.

The Collision works just fine so far as long as the z-position of my blocks (on which the player can stand) is between ~ -0.5 and 0.5. I put all blocks in a folder in the scene-hierarchy. 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 this 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 something.

Both solutions would work. I tested them. But I guess both implementations are dirty work. I'd rather know the reason of this strange behavior and fix it, so that I can place the graphics 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/graphics later (or tomorrow). But I don't really think that it's necessary. At least in order to understand what i'm doing.

short summary: moving Graphics/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 something to do with wrong settings or so (which 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

Son, nothing about that "explains itself." You even talk about things that don't exist such as "folders in the scene-hierarchy". Show your work, maybe then someone can help debug it.

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 think 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

Thank you, robertbu. But that doesn't work either. The z-position still changes.

avatar image robertbu · Mar 18, 2013 at 04:57 PM 0
Share

You need to do as @nxdavid suggest and provide a screen shot and a better explanation of what you are doing. If you use the spinner to orient on the 'X' 'Y' plane, and/or you only drag on an arrow (never within the bounds of the object), then I cannot see any way you would get Z movement out of an 'X' or 'Y' arrow drag.

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

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

Object following a path and colliding with other objects with physics. 1 Answer

How to detect an object inside another object? 1 Answer

2D Collision problem 1 Answer

Checking for collision with 2D objects/sprites 3 Answers

for C I want to change the Collider other for the public ? 1 Answer


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