Add a sprite to a LowLevelPhysics2D API object
Add a SpriteRenderer component to a GameObject that has a physics script attached.
Read time 1 minuteLast updated 13 days ago
After you create a physics object, to add a sprite, add a Sprite Renderer component. Follow these steps:
- In the Hierarchy window, select the GameObject with the API script.
LowLevelPhysics2D - Select Add Component.
- Select Rendering > .Sprite Renderer
?
You can also drag a sprite asset in the Project window to the GameObject in the Hierarchy window. This approach creates a new GameObject as a child of the physics body GameObject.
By default the sprite doesn't move with the physics object. To make the sprite move, refer to Move a GameObject with the physics API.