Version: Unity 6.1 Alpha (6000.1)
LanguageEnglish
  • C#

PhysicsScene2D

struct in UnityEngine

/

Implemented in:UnityEngine.Physics2DModule

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Represents a single instance of a 2D physics Scene.

A 2D physics Scene owns all 2D physics component objects added to it and can perform a simulation of them as well as execute queries against them. All of this functionality is isolated from any other physics Scene. Using this, multiple independent physics Scenes can coexist.

Properties

subStepCountThe number of simulation sub-steps that occurred during the last simulation step.
subStepLostTimeThe amount of simulation time that has been "lost" due to simulation sub-stepping hitting the maximum number of allowed sub-steps.

Public Methods

BoxCastCasts a box against colliders in the PhysicsScene2D, returning the first intersection only.
CapsuleCastCasts a capsule against colliders in the PhysicsScene2D, returning the first intersection only.
CircleCastCasts a circle against colliders in the PhysicsScene2D, returning the first intersection only.
GetRayIntersectionCast a 3D ray against the 2D Colliders in the Scene.
IsEmptyDetermines whether the physics Scene is empty or not.
IsValidDetermines whether the physics Scene is valid or not.
LinecastCasts a line segment against colliders in the PhysicsScene2D, returning the first intersection only.
OverlapAreaChecks an area (non-rotated box) against Colliders in the PhysicsScene2D, returning the first intersection only.
OverlapBoxChecks a box against Colliders in the PhysicsScene2D, returning the first intersection only.
OverlapCapsuleChecks a capsule against Colliders in the PhysicsScene2D, returning the first intersection only.
OverlapCircleChecks a circle against Colliders in the PhysicsScene2D, returning the first intersection only.
OverlapPointChecks a point against Colliders in the PhysicsScene2D, returning the first intersection only.
RaycastCasts a ray against colliders in the PhysicsScene2D, returning the first intersection only.
SimulateSimulate physics associated with this PhysicsScene.

Static Methods

OverlapColliderChecks a Collider against Colliders in the PhysicsScene2D, returning all intersections.