From c7a4b6a8beaa8cf68249aa2c1327fe5ee266f1e3 Mon Sep 17 00:00:00 2001 From: Jummit Date: Thu, 12 Aug 2021 23:01:37 +0200 Subject: [PATCH] Fix example in Optimization Using Servers tutorial (#5169) --- tutorials/performance/using_servers.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tutorials/performance/using_servers.rst b/tutorials/performance/using_servers.rst index 413fda6b6..c174080b5 100644 --- a/tutorials/performance/using_servers.rst +++ b/tutorials/performance/using_servers.rst @@ -176,8 +176,9 @@ and moves a :ref:`CanvasItem ` when the body moves. body = Physics2DServer.body_create() Physics2DServer.body_set_mode(body, Physics2DServer.BODY_MODE_RIGID) # Add a shape. - shape = RectangleShape2D.new() - shape.extents = Vector2(10, 10) + shape = Physics2DServer.rectangle_shape_create() + # Set rectangle extents. + Physics2DServer.shape_set_data(shape, Vector2(10, 10)) # Make sure to keep the shape reference! Physics2DServer.body_add_shape(body, shape) # Set space, so it collides in the same space as current scene.