|
Deki 0.40.1
비주얼 에디터가 있는 2D·3D 모듈식 C++ 엔진
|
이 가이드는 아직 번역되지 않았습니다.
Things that fall, bounce and collide. Install deki-physics-2d from the Package Manager first.
Colliders are drawn in the Scene View. Select an object to drag the handles on its collider.
Positions are in meters and up is positive.
| Type | Moved by |
|---|---|
| Dynamic | Physics: gravity, forces and collisions |
| Kinematic | Your code, through its velocity. It pushes dynamic bodies and is not pushed |
| Static | Nothing |
An object with a collider and no Rigidbody 2D is a wall: it stays where it is unless you move it.
Turn on Freeze Rotation to keep a player upright.
Use Box, Circle, Capsule or Polygon Collider 2D. A capsule slides over small steps, which suits characters. A polygon has up to 8 corners and is always convex.
Friction is how much it grips and Bounciness how much it bounces.
Layer and Mask decide who touches whom. Each is a set of bits, and two colliders touch only if each one's Mask includes the other's Layer.
Turn on Is Trigger for an area that notices things without blocking them, such as a pickup or a goal.
It is safe to destroy an object from inside these.
To ask what is along a line:
Hinge Joint 2D pins a body at one point, free to turn: doors, chains and wheels. Distance Joint 2D keeps two points a set distance apart. With Rope on, they can come closer but not move further apart. Add either to an object that has a Rigidbody 2D.