Godot Version
Godot Engine v4.2.2.stable.mono.official.15073afe3
C# version
Question
I want to set different radiu
Scenes:
- Node2D
- Area2D
- CollisionShape2D : {Shape:CircleShape2D}
- Area2D
Codes:
public override void _Ready()
{
viewArea = Main.GetChildNode(this, “Area2D”);
GD.Print(“view area:”+viewArea);
viewArea.AreaEntered += (area) => GD.Print(“view area entered:”+area);
CollisionShape2D viewShape = viewArea.GetNode(“CollisionShape2D”);
GD.Print(“view area shape:”+viewShape);
GD.Print(“view area shape inner shape:”+viewShape.Shape);
// return a same CircleShape2D in different Area2D _Ready method
var shape = (CircleShape2D) viewShape.Shape;
shape.Radius = model.viewRange;
}
question: var shape = (CircleShape2D) viewShape.Shape;
I Cannot get different Shape instance on different CollisionShape2D
logs:
view area:<Area2D#28303164645>
view area shape:<CollisionShape2D#28319941853>
view area shape inner shape:<CircleShape2D#-9223372008719383329>
view area:<Area2D#28487714034>
view area shape:<CollisionShape2D#28504491251>
view area shape inner shape:<CircleShape2D#-9223372008719383329>
I got the same Shape:9223372008719383329
please help