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 Zerod · Dec 04, 2013 at 08:24 AM · 2dphysicsgameunity4.3

2 2D Physics Rooms/Worlds

Hi, i want to make a Top-Down Space Game with a Player in a Spaceship. The Player can walk in the ship and for example controll it by using a monitoring desk. So i want 1 physics Room/world for the inner Ship and 1 physics Room/world for the universe so that the Players or the Enemys IN the ship have nothing to do with the Ships movements.

Is that possible?

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

Answer by Spinnernicholas · Dec 04, 2013 at 04:18 PM

Yes, by using layers, you can change effectively create two or more separate physics areas.

You would have layers for the "ship space".

And separate layers for the "universe space".

Then, in the physics options, you would set which layers interact.

The only thing that you can't separate is gravity. I'm assuming you won't have any gravity while on the ship, so you can set the local gravity for rigidbodies in "ship space" to 0. Then, setting the gravity will effect only things in "Universe Space".

Comment
Add comment · Show 6 · 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 Spinnernicholas · Dec 04, 2013 at 05:36 PM 0
Share

$$anonymous$$ake everything on the ship, including the player a child of the ship.

avatar image Zerod · Dec 04, 2013 at 05:38 PM 0
Share

It is already.

avatar image Spinnernicholas · Dec 04, 2013 at 05:51 PM 0
Share

Create a new gameobject to represent the inside of the ship. It will be separate from and not a child of the gameobject that represents the ship as a whole. Then write a script that manually positions it with the outside of the ship.

[1]: http://docs.unity3d.com/Documentation/Components/class-FixedJoint.html

avatar image Spinnernicholas · Dec 08, 2013 at 06:37 AM 0
Share

$$anonymous$$nock knock!

avatar image Zerod · Dec 11, 2013 at 05:31 PM 0
Share

I know that... but what if i have some players, bullets and enemys with physic?

Show more comments
avatar image
0

Answer by Zerod · Dec 04, 2013 at 05:18 PM

The problem is that the ship has a BoxCollider2D with Rigidbody2D and the player too, now if the ship moves the player collider stays where it has started... does anyone know why or a work around?

PS: the player and ship are on different uncolliding layers.

Problem as Image


unityproblem.jpg (165.1 kB)
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

17 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to run a script every time a scene is loaded. 0 Answers

Sprite rendering problem 0 Answers

2d physics problem 1 Answer

New Pointer Effector 2D Help 0 Answers

2-d game creation code help 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