• 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 Rabadash8820 · May 03, 2016 at 04:38 AM · physics2d game2d-physics

To Use or Not to Use 3D Physics in 2D Game

I have a lot of scripts written for a 3D game that would be useful in a 2D game, and I really don't want to reinvent the wheel to add them to that game. So my question is, can I use my current 3D game scripts (with Vector3s and calls to Physics.Raycast(), Physics.Gravity, etc.) in a 2D game (where all the GameObjects have 2D components like Collider2D and Rigidbody2D and there will be other scripts using calls to Physics2D.Raycast(), Physics2D.Gravity, etc.)? I'm guessing that I can do it but that it will be stupid inefficient, so I might as well re-implement with 2D classes, but figured I'd ask first.

Thanks in advance!

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by tanoshimi · May 03, 2016 at 05:39 AM

You can do it - the two systems don't interact and won't interfere with each other, but clearly any given object in your scene can only either be under the influence of one or the 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

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

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

When an object bounces between two bouncy objects it goes through them 1 Answer

2D game - Sprite deformation when add frce 2 Answers

How can I make sure triggers or collisions are never skipped even for high speeds? 2 Answers

I have a problem with 2D terrain, help mee! 0 Answers

Is there a standardized way for creating a 2D ball physics movement method? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges