Godot Version
4.3 stable official [77dcf97d8]
Question
I’m trying to make a marquee text which also could be a platform
I used control node to clip content
inside there AnimatableBody2D / TextEdit collision object
The problem is that collision shaped needs to grow / shrink on side when it’s coming / leaving control node
so which make player not moving (because it’s not moving it’s position, just grows / shrinks)
Any possible way to make my player walking? I’m thinking about just have another area or something to player notices on marquee text and let just move player’s position … which I think that’s not beauty
if is_marquee:
textTile.textEdit.position += movement * delta
var control_rect: Rect2 = get_global_rect()
var collision_shape: CollisionShape2D = textTile.collisionShape2D
var collision_rect: RectangleShape2D = collision_shape.shape as RectangleShape2D
#
if collision_shape.global_position.x + collision_rect.size.x / 2 >= control_rect.position.x + control_rect.size.x:
var growed_rect: Rect2 = collision_rect.get_rect().grow_side(SIDE_RIGHT, -marquee_speed * delta)
if growed_rect.size < Vector2.ZERO:
collision_shape.disabled = true
wait_for_reset = true
timer.start()
else:
collision_rect.size = growed_rect.size
collision_shape.position.x += marquee_speed * delta / 2
elif (collision_rect.size < textTile.collision_size):
var growed_rect: Rect2 = collision_rect.get_rect().grow_side(SIDE_RIGHT, marquee_speed * delta)
collision_rect.size = growed_rect.size
collision_shape.position.x += marquee_speed * delta / 2
else:
collision_shape.position.x += marquee_speed * delta