@Sparrow said:
Hello again
Got this from the docs
I think it's result.Object
Or
result.ObjectID
In GDscript
Or
In C#
if (result.Count > 0)
GD.Print("Hit at point: ", result["collider_id"]);
position: Vector2 # point in world space for collision
normal: Vector2 # normal in world space for collision
collider: Object # Object collided or null (if unassociated)
collider_id: ObjectID # Object it collided against
rid: RID # RID it collided against
shape: int # shape index of collider
metadata: Variant() # metadata of collider
Hey, I have a new problem related to this
I have the following code
Physics2DDirectSpaceState spaceState = GetWorld2d().DirectSpaceState;
Godot.Collections.Array exc = new Godot.Collections.Array() {this};
var result = spaceState.IntersectRay(Position, GetTree().GetRoot().GetNode<Node2D>("Level/Player").Position, exc);
if(result != null)
{
if(result["collider_id"] != null)
GD.Print(result["collider"].ToString());
}
Here is the error
It says dictionary doesn't have the keyword "collider_id".