Merge pull request #73248 from constantitus/characterbody2d-csharp-doc

fixed c# example in CharacterBody2D doc
This commit is contained in:
Rémi Verschelde 2023-02-13 23:44:48 +01:00
commit 9721d557d0
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -71,10 +71,10 @@
print("Collided with: ", collision.collider.name) print("Collided with: ", collision.collider.name)
[/gdscript] [/gdscript]
[csharp] [csharp]
for (int i = 0; i < GetSlideCount(); i++) for (int i = 0; i < GetSlideCollisionCount(); i++)
{ {
KinematicCollision2D collision = GetSlideCollision(i); KinematicCollision2D collision = GetSlideCollision(i);
GD.Print("Collided with: ", (collision.Collider as Node).Name); GD.Print("Collided with: ", (collision.GetCollider() as Node).Name);
} }
[/csharp] [/csharp]
[/codeblocks] [/codeblocks]