如何在Godot代码中定义OcclusionrPolygon2D
我使用的代码
var shape: PoolVector2Array = [Vector2(0,0), Vector2(0,70), Vector2(70,0), Vector2(70,70)]
set_occluder_polygon(shape)
由于类型不同而出现错误。我使用这个是因为 OcclusionrPolygon2D 有 PoolVector2Array Polygon
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想您有一个
lightoccluder2d
,并且要设置其oxpluder
(这是oxcluderPolygon2d
)。如果已经有一个,则应该能够直接设置其点。类似的东西:否则,您将必须创建
oxCluderPolygon2d
:I presume you have a
LightOccluder2D
and you want to set itsoccluder
(which is aOccluderPolygon2D
). If it already has one, you should be able to set its points directly. Something like this:Otherwise, you would have to create a
OccluderPolygon2D
: