You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
An Area2D's area does not scale with its parent, while the debug shape visualizer and default Godot physics do scale the area with the parent. Maybe there should be a disclaimer that Area2D's are not scalable as it is not a "Drop-In replacement" otherwise.
To Reproduce
Steps to reproduce the behavior:
Use the Rapier Engine
Have a node with child that is Area2D
Scale the node
Notice the Area2D did not scale (and if the debug shape visualizer is enabled it did scale)
Expected behavior
When the parent scales, so does the child Area2D
Environment (please complete the following information):
OS: Arch Linux
Version 0.6.18
Godot Version 4.2.2
Type SIMD
Example project
Insert this code into a Node2D using Rapier physics. Play with the slider to try different scales. Mousing over the sprite should turn it black, however (unless you use default physics) the sprite doesn't properly represent the Area2D, because the Area2D didn't scale. Also notice the debug shape did scale if it is enabled.
extends Node2D
func _ready():varp=Node2D.new()
p.position =Vector2(400,400)add_child(p)
# Area that does not scale asexpectedvara=Area2D.new()varc=CollisionPolygon2D.new()
c.polygon =[Vector2(-100,-100),Vector2(100,-100),Vector2(100,100),Vector2(-100,100)]
a.add_child(c)
p.add_child(a)
# Sprite to show when a the mouse is in its area
vars=Sprite2D.new()
s.texture = preload('res://icon.svg')
s.scale =Vector2(200,200)/ s.texture.get_size()
a.mouse_entered.connect(func(): s.modulate =Color(0,0,0))
a.mouse_exited.connect(func(): s.modulate =Color(1,1,1))
p.add_child(s)
# Slider to scale the node
varv=VSlider.new()
v.step = 0.01
v.max_value =4
v.value_changed.connect(func(value): p.scale =Vector2.ONE * value)
v.size.y =200add_child(v)
The text was updated successfully, but these errors were encountered:
The function body_set_transform only takes rotation and position, it doesn't take into account scale. For this to work I would need to change when creating a collider, apply the scale of the body over it. But I would need to be careful with the order of operations to match the one in godot.
Describe the bug
An Area2D's area does not scale with its parent, while the debug shape visualizer and default Godot physics do scale the area with the parent. Maybe there should be a disclaimer that Area2D's are not scalable as it is not a "Drop-In replacement" otherwise.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When the parent scales, so does the child Area2D
Environment (please complete the following information):
Example project
Insert this code into a Node2D using Rapier physics. Play with the slider to try different scales. Mousing over the sprite should turn it black, however (unless you use default physics) the sprite doesn't properly represent the Area2D, because the Area2D didn't scale. Also notice the debug shape did scale if it is enabled.
The text was updated successfully, but these errors were encountered: