Description
Tested versions
Does not work in 4.4-dev2, 4.3-stable, 4.3-beta1, 4.3-dev5
Works in 4.2.2-stable, 4.3-dev3, 4.3-dev4
System information
Godot v4.2.2.stable - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4050 Laptop GPU (NVIDIA; 32.0.15.6070) - 13th Gen Intel(R) Core(TM) i5-13500HX (20 Threads)
Issue description
To start, let me show a working version of what is supposed to happen, in Godot 4.2.2-stable.
On the left, there is a RigidBody3D node riding atop of a kinematic body created by the PhysicsServer3D. On the left is the same thing except the rigidbody is a CharacterBody3D.
The moving platform is created with the following little script:
extends MeshInstance3D
var body: RID = PhysicsServer3D.body_create()
func _ready() -> void:
PhysicsServer3D.body_set_space(body, get_world_3d().space)
var shape: RID = PhysicsServer3D.box_shape_create()
PhysicsServer3D.shape_set_data(shape, Vector3.ONE *0.5)
PhysicsServer3D.body_add_shape(body, shape)
PhysicsServer3D.body_set_mode(body, PhysicsServer3D.BODY_MODE_KINEMATIC)
func _physics_process(delta: float) -> void:
position.x = sin(Engine.get_physics_frames() * 0.01)
PhysicsServer3D.body_set_state(body, PhysicsServer3D.BODY_STATE_TRANSFORM, global_transform)
This was behavior I used in my game - it allowed to have a ton of moving platforms without using the SceneTree.
When loaded in Godot 4.3-stable, instead it acts like the right body is a StaticBody to the characterbody, but for some reason still works on the RigidBody.
Setting the body mode to BODY_MODE_STATIC is now no different from BODY_MODE_KINEMATIC.
I went and tested random 4.3 versions till I could find which one introduced this change.
4.3-beta1 - Does not work
4.3-dev3- Works
4.3-dev4 - Works
4.3-dev5 - Does not work
So it was a change inside of 4.3-dev5 that broke it, as it works inside 4.3-dev4 but not 4.3-dev5
Here it is in 4.3-dev4, working as intended.
NOTE: Using a CharacterBody3D as a moving platform still works, but this is related to using the PhysicsServer3D to create these bodies.
Steps to reproduce
See above, creating moving platforms using PhysicsServer3D works in Godot 4.3-dev4 but not Godot 4.3-dev5.