You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue description:
With C#, Trying to implement a collision in the scene using the PhysicsServer doesn't work. The game runs and there's no error in the terminal output but the collision isn't there. No interaction possible.
I actually find the source of the problem. The C# API doesn't match the GDScript one for BodyAddShape.
The GDScript PhysicsServer API describes the function like this : void body_add_shape ( RID body, RID shape, Transform transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), bool disabled=false )
The C# API like this : public static void BodyAddShape(RID body, RID shape, Transform? transform = null, bool disabled = false);
In C# the transform parameter is null by default instead of a transform with a default value. We must provide it or the resulting shape will not appear in the scene.
The C# API should be changed to match the GDScript one.
The text was updated successfully, but these errors were encountered:
Looks like the issue might come from the BodyAddShape(RID body, RID shape) PhysicsServer's method. Everything works if I ask a GDScript node to call it instead.
Godot version:
3.2.3 Mono
OS/device including version:
Kubuntu 20.04
Issue description:
With C#, Trying to implement a collision in the scene using the PhysicsServer doesn't work. The game runs and there's no error in the terminal output but the collision isn't there. No interaction possible.
Minimal reproduction project:
https://github.com/snouk-z/test_servers
The repository also contains a GDScript implementation (which is working) to show the expected result.
EDIT
I actually find the source of the problem. The C# API doesn't match the GDScript one for
BodyAddShape
.The GDScript PhysicsServer API describes the function like this :
void body_add_shape ( RID body, RID shape, Transform transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), bool disabled=false )
The C# API like this :
public static void BodyAddShape(RID body, RID shape, Transform? transform = null, bool disabled = false);
In C# the transform parameter is null by default instead of a transform with a default value. We must provide it or the resulting shape will not appear in the scene.
The C# API should be changed to match the GDScript one.
The text was updated successfully, but these errors were encountered: