diff --git a/MovingPlatform.gd b/MovingPlatform.gd index a4cbdb1..7f1cbe7 100644 --- a/MovingPlatform.gd +++ b/MovingPlatform.gd @@ -31,7 +31,7 @@ func _process(delta): velocity = (translation - translation_before) / delta # Rotate according to gravity - var gravity_acceleration = get_node(solar_system).get_gravity_acceleration(global_transform.origin) + var gravity_acceleration = get_node(solar_system).get_closest_gravity_acceleration(global_transform.origin) # Rotate down vector to face center of gravity var down = gravity_acceleration diff --git a/World.tscn b/World.tscn index ba97ff8..d29d95b 100644 --- a/World.tscn +++ b/World.tscn @@ -13,10 +13,10 @@ [ext_resource path="res://LerpedFollow.gd" type="Script" id=11] [sub_resource type="CubeMesh" id=1] -size = Vector3( 4, 0.5, 4 ) +size = Vector3( 10, 0.5, 10 ) -[sub_resource type="ConvexPolygonShape" id=2] -points = PoolVector3Array( -2, 0.25, 2, 2, 0.25, -2, 2, 0.25, 2, -2, 0.25, -2, -2, -0.25, 2, 2, -0.25, -2, 2, -0.25, 2, -2, -0.25, -2, 2, 0.25, 2, -2, 0.25, -2, 2, 0.25, -2, -2, 0.25, 2, 2, -0.25, 2, -2, -0.25, -2, 2, -0.25, -2, -2, -0.25, 2, 2, 0.25, 2, -2, -0.25, 2, -2, 0.25, 2, 2, -0.25, 2, 2, 0.25, -2, -2, -0.25, -2, -2, 0.25, -2, 2, -0.25, -2 ) +[sub_resource type="ConcavePolygonShape" id=12] +data = PoolVector3Array( -5, 0.25, 5, 5, 0.25, 5, -5, -0.25, 5, 5, 0.25, 5, 5, -0.25, 5, -5, -0.25, 5, 5, 0.25, -5, -5, 0.25, -5, 5, -0.25, -5, -5, 0.25, -5, -5, -0.25, -5, 5, -0.25, -5, 5, 0.25, 5, 5, 0.25, -5, 5, -0.25, 5, 5, 0.25, -5, 5, -0.25, -5, 5, -0.25, 5, -5, 0.25, -5, -5, 0.25, 5, -5, -0.25, -5, -5, 0.25, 5, -5, -0.25, 5, -5, -0.25, -5, 5, 0.25, 5, -5, 0.25, 5, 5, 0.25, -5, -5, 0.25, 5, -5, 0.25, -5, 5, 0.25, -5, -5, -0.25, 5, 5, -0.25, 5, -5, -0.25, -5, 5, -0.25, 5, 5, -0.25, -5, -5, -0.25, -5 ) [sub_resource type="PhysicsMaterial" id=3] friction = 0.0 @@ -118,7 +118,7 @@ mesh = SubResource( 1 ) material/0 = null [node name="CollisionShape" type="CollisionShape" parent="MovingPlatformPivot/MovingPlatform"] -shape = SubResource( 2 ) +shape = SubResource( 12 ) [node name="Planets" type="Spatial" parent="."] script = ExtResource( 2 )