Skip to content

Commit 6a00fff

Browse files
committed
platform: Make collision shapes local to scene
Previously, the collision shapes were shared between each instance of the scene. This means that if you placed 2 platforms in a scene, and set one of them to be 2 tiles wide and the other to 3 tiles wide, the collision shapes would both be as wide as the last platform in the scene tree, rather than matching their visible size. Making the resources local_to_scene causes them to be duplicated when the scene is instanced.
1 parent bf74940 commit 6a00fff

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

components/platform/platform.tscn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
[ext_resource type="Script" uid="uid://dilh5jyuklov6" path="res://components/platform/platform.gd" id="1_dpc6h"]
44

55
[sub_resource type="RectangleShape2D" id="RectangleShape2D_i4vtk"]
6+
resource_local_to_scene = true
67
size = Vector2(256, 40)
78

89
[sub_resource type="RectangleShape2D" id="RectangleShape2D_o2vn2"]
10+
resource_local_to_scene = true
911
size = Vector2(256, 128)
1012

1113
[sub_resource type="Animation" id="Animation_6232f"]

0 commit comments

Comments
 (0)