You are viewing PyUnity docs under the
As such, they are only applicable if you installed from source.
Go to https://docs.pyunity.x10.bz/en/latest/ for the most recent
A basic 3D Physics engine that uses similar concepts to the Unity Engine itself. Only supports non-rotated colliders.
To create an immoveable object, use
math.inf or the provided
variable. This will make the object
not be able to move, unless you set
an initial velocity. Then, the
collider will either push everything
it collides with, or bounces it back
at twice the speed.
>>> cube = GameObject("Cube") >>> collider = cube.AddComponent(BoxCollider) >>> collider.SetSize(-Vector3.one(), Vector3.one()) >>> collider.velocity = Vector3.right()
If you want to change some configurations, import the config file like so:
>>> from pyunity.physics import config
Inside the config file there are some configurations:
gravityis the gravity of the whole system. It only affects Rigidbodies that have
Rigidbody.gravityset to True.