Tony Porteous
Tony Porteous

Reputation: 61

Unity 4.6 Canvas - How to correctly apply 2D physics effects

Is there a way to universally multiply physics2D calculations on the canvas?

I'm trying to make a set of canvas UI elements with 2D physic properties. The objects contain images and text, but need to respond to gravity, impacts, and overlapping collision boxes with other GUI elements.

I've added 2D RigidBody and boxCollider components to my objects. However, they move very slowly. If given a gravity, they fall slowly. If overlapped, they push each other apart slowly.

I've figured out that this is due to the canvas having a very large scale. My objects are effectively 'very big and very far away'.

My canvas objects have widths akin to 80, where unity physics expects widths akin to 1. How can I get them to behave like they have a width of 1?

Is there some universal scaling factor for canvas based physics, or am I simply mis-using the canvas for something it is not intended for?

Upvotes: 1

Views: 4087

Answers (1)

Rickest Rick
Rickest Rick

Reputation: 1565

if you are still having this problem, the answer to fixing the movement rates of your scaled-up objects is to scale up your movement forces as well as your gravity. If you can't get certain elements to work right, use a forcepush that you can set to any strength.

Upvotes: 1

Related Questions