system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
hard |
I am using this code
var shape: PoolVector2Array = [Vector2(0,0), Vector2(0,70), Vector2(70,0), Vector2(70,70)]
set_occluder_polygon(shape)
which gives error because of not having same type. I used this because OccluderPolygon2D has PoolVector2Array Polygon
system
2
|
|
|
|
Reply From: |
matheusmdx |
You need create a new OccluderPolygon2D resource and in this new resource you pass the PoolVector2Array with the points
var light_occluder = LightOccluder2D.new()
add_child(light_occluder)
var occluder_polygon = OccluderPolygon2D.new()
occluder_polygon.polygon = PoolVector2Array([Vector2(0,0), Vector2(0,70), Vector2(70,0), Vector2(70,70)])
light_occluder.set_occluder_polygon(occluder_polygon)